3
我的代碼點火器路由文件中有如下路由。帶尾部斜線的URL導致不同的頁面 - MVC CI
$route['profile'] = "profile";
類配置文件包含以下
$this->load->view('pages/profile.php');
現在我有一個類似如下
<a href = 'logout'>Logout</a>
現在考慮使用它用戶我profile.php頁面上的鏈接。如果他現在訪問以下網址
localhost/project/profile
然後profile.php頁面上的鏈接會導致以下
localhost/project/logout
但是,如果用戶使用此URL
localhost/project/profile/
那如果存在斜線,則頁面上的鏈接將導致
localhost/project/profile/logout
現在我的問題是我應該做在這兩種情況下的鏈接導致
localhost/project/logout
希望我是清楚的。請幫我出
爲什麼不使用codeingiter url helper? Logout – 2013-02-22 15:14:30
@FabioAntunes幫助。謝謝。任何來到這裏的人都會發現這個網址很有用 - http://ellislab.com/codeigniter/user-guide/helpers/url_helper.html – Srivathsan 2013-02-22 15:19:32