0
我有categorie控制器,具有指標作用的Zend控制器的所有行動,以一個動作
我需要的是,當我輸入地址.com/categorie/education
它使用與參數教育.com/categorie/index/education
或重定向的一切行動,以指數索引操作? ?
我有categorie控制器,具有指標作用的Zend控制器的所有行動,以一個動作
我需要的是,當我輸入地址.com/categorie/education
它使用與參數教育.com/categorie/index/education
或重定向的一切行動,以指數索引操作? ?
您的路線設置如何?鑑於所提供的信息缺乏我必須假設您正在使用一個.ini文件,這是它如何工作:
; CATEGORIE
categorie.type = "Zend_Controller_Router_Route_Static"
categorie.route = "categorie"
categorie.defaults.controller = categorie
categorie.defaults.action = index
categorie_view.route = "categorie/:slug"
categorie_view.defaults.controller = category
categorie_view.defaults.action = view
注意,我也改變了一下,作爲索引的動作, imo,應列出所有類別。這樣你有一個viewAction列出個人的分類。
把它作爲你的要求,我相信它會是這樣的:
; CATEGORIE
categorie.route = "categorie/:slug"
categorie.defaults.controller = categorie
categorie.defaults.action = index
http://codeutopia.net/blog/2007/11/16/routing-and-complex-urls-in- zend框架/找到更好的答案 – Edmhs 2010-11-08 16:09:53