我必須在控制器文件夾中名稱about.php的控制器。現在在視圖文件夾中我有一個名爲about.php的視圖。在index.php視圖中,我想通過鏈接調用該視圖,但它不會調用我對Codeignitor的新功能。麻煩呼叫視圖
這是我的index.php調用代碼
<a href="<?php echo base_url();?>About/about">About Us</a>
這是控制器的文件夾我的控制器代碼about.php。
class About extends CI_Controller {
function index(){
$this->load->view('about');
}
}
謝謝侑先生是工作正常,但我的鏈接是這樣的「http://localhost/CodeIgniter/index.php/about」我們可以刪除.PHP或索引。從這個鏈接的PHP – Nasir
是的,你可以做一個簡單的改變你的.htaccess文件。這是在CodeIgniter文檔中:http://ellislab.com/codeigniter/user-guide/general/urls.html – Tom
先生什麼是index.php這裏可以解釋一下 – Nasir