在 Codeigniter 中设置链接
我正在尝试在 Codeigniter 2.0 中制作一个简单的导航菜单,但无法弄清楚如何链接到我的其他视图。
<ul>
<li>About</li>
<li>Links</li>
</ul>
我对我的观点进行了编码。它们是:关于和链接
如何在我的控制器中设置链接?如何在我的视图中设置导航链接?
I'm trying to make a simple navigation menu in Codeigniter 2.0 and cant figure out how to make links to my other views.
<ul>
<li>About</li>
<li>Links</li>
</ul>
I have My Views coded. They are: about and links
How do I set up the links in my controller? How do I set up the nav links in my view?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用锚。例如:
将生成:
我的新闻
您需要此 URL 帮助器
$this->load->helper('url');
Use anchor. For example:
Would produce:
<a href="http://example.com/index.php/news/local/123" title="News title">My News</a>
You need the URL helper for this
$this->load->helper('url');
您可以使用 CI URL 助手: http://codeigniter.com/user_guide/helpers/url_helper.html< /a>
他们也解释了基本的例子。
You can use CI URL Helper : http://codeigniter.com/user_guide/helpers/url_helper.html
They have explained basic examples as well.