我是新来的CI和URI路由的一般。CodeIgniter:简单的URL路由问题
我创建了一个新的应用程序。将默认控制器设置为Main
。在Main
中,我有一个index
方法,一个popular
方法和一个recent
方法。
当我加载我的应用程序时,网址显示为http://localhost/myapp
...这显然加载方法Main
控制器...这很好。
现在我该如何路由我的URI,以便我可以分别使用http://localhost/myapp/popular
和http://localhost/myapp/recent
加载流行和最近的方法?
您不能拥有名称为“index”的控制器。它是保留的。 请参阅http://codeigniter.com/user_guide/general/reserved_names.html – 2009-11-03 01:35:41
糟糕。是的,修正了错字。指数应该是主要的。 – Franz 2009-11-03 01:42:45
没问题。它发生了:) – 2009-11-03 07:04:05