Answer the question
In order to leave comments, you need to log in
Find out which router processes a specific url?
I have a set of urls in my controller, for example:
_www.mydomain.com/blog/blog-item-12345.html
news.mydomain.com/last-news-6789.html
another-subdomain.mydomain.com/path/path /id/…
How to find out which router processes each url? Those. I need to know the module, controller and action that will be called.
Answer the question
In order to leave comments, you need to log in
I won’t tell you specifically, but this is usually configured in application/Bootstrap.php in the _initRoutes() function or through configuration files.
$router->addRoute($name,
new Zend_Controller_Router_Route($url,
array('module' => $module, 'controller' => $controller, 'action' => $action, )));
So have you tried it?
In controller:
$request = $this->getRequest();
$controllerName = $request->getControllerName();
$actionName = $request->getActionName();
$moduleName = $request->getModuleName();
in the other place:
$request = Zend_Controller_Front::getInstance()->getRequest();
$controllerName = $request->getControllerName();
$actionName = $request->getActionName();
$moduleName = $request->getModuleName();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question