我正在尝试将操作映射到基本 URL 和默认控制器。
发誓这应该是直截了当的,甚至是“开箱即用”的功能,但是如何使用 Zend 框架将默认控制器中的操作映射到基本 url?我对框架相当陌生,所以我希望我只是错过了一些明显的东西。
尝试映射:
domain.com/index/my-page 到 domain.com/my-page
默认情况下不会破坏任何其他路由设置。
我可以使用 Zend_Router 破解它,但它违反了其他规则,例如 /:controller/:action /:module/:controller/:action
注意:/index/my-page 是一个示例 url - 我需要它动态地为所有 indexController 操作工作。
'tharkun' indexController 请求的 URL 映射示例具有方法 indexAction 和 contactAction 需要 url
/index
/index/contact
/
/contact
第二个控制器 testController 有方法 indexAction 和 monkeyAction 需要 url
/test
/test/index
/test/monkey
基本上 - 如果系统找不到 VAR 的控制器,那么它会在默认控制器中查找 VAR 的操作