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