如果我有这样的网址,http://example.com/controller/action
每件事都能找到。正如预期的那样。但是我需要部署它,并且在部署中事情会有所改变,htttp://deploy.com/stuff/pile/controller/action
是否有任何方法可以在 zend 中控制它。
提前致谢。
如果我有这样的网址,http://example.com/controller/action
每件事都能找到。正如预期的那样。但是我需要部署它,并且在部署中事情会有所改变,htttp://deploy.com/stuff/pile/controller/action
是否有任何方法可以在 zend 中控制它。
提前致谢。
将此路由添加到您的引导程序:
protected function _initRoute() {
$front = Zend_Controller_Front::getInstance();
$router = $front->getRouter();
$router->addRoute(
'prefix_route',
new Zend_Controller_Router_Route('stuff/pile/:controller/:action',
array('controller' => $front->getRequest()->getControllerName(),
'action' => $front->getRequest()->getActionName())));
);
}