我是新來的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