i am implementing the Zend Regex Routing, and i have to perform multiple checks for the url. For example, if this is my url:
http://localhost/application/public/index.php/module/controller/action
and this is my regex condition in my bootstrap file, which matches when the url does not contain “login”:
$router->addRoute('ui', new Zend_Controller_Router_Route_Regex(
'^((?!login/).)*$',
array(
'module' => 'mod1',
'controller' => 'cont1',
'action' => 'action1'
),
array( )
));
Now i also want to identify the pattern: ([^-]*)/([^-]*)/([^-]*) from the url for knowing the module, controller and action, so that i can route to it.
How can it be achieved ?
I know absoluely nothing about Zend, but the regex:
matches:
on the input:
The part
(?=((?!login/).)*$)makes sure there is nologin/in the string, and([^-/]*)/([^-/]*)/([^-/]*)/?$grabs the last three.../before the end of the input ($).HTH