|
|||
|
Hi,
Why this regex route doesn't match the module? $router->addRoute( 'regex1', new Zend_Controller_Router_Route_Regex( 'tcontrol/(.+/)*', array( 'module'=>'mod', 'controller' => 'control', 'action' => 'index' ), array( 1 => 'action' ) ) ); With url : http://www.example.com/tcontrol/cale.../p3/tyu/p4/hjk array(7) { ["controller"]=> string(7) "tcontrol" ["action"]=> string(10) "calendar" ["p1"]=> string(2) "jh" ["p2"]=> string(3) "ert" ["p3"]=> string(3) "tyu" ["p4"]=> string(3) "hjk" ["module"]=> string(7) "default" } Thks. |
|
|||
|
I'd tried:
$router->addRoute( 'regex1', new Zend_Controller_Router_Route_Regex( 'tcontrol/(.+?)/*', array( 'module'=>'mod', 'controller' => 'tcontrol', 'action' => 'index' ), array( 1 => 'action' ) ) ); Na url : http://www.example.com/tcontrol/cale.../p3/tyu/p4/hjk array(3) { ["action"]=> string(37) "calendario/p1/jh/p2/ert/p3/tyu/p4/hjk" ["module"]=> string(3) "mod" ["controller"]=> string(7) "control" } What's wrong? |
|
||||
|
When you're module name isn't default, your url should be prefixed with it. If you do that, and have a proper dir layout, you won't need to add a route like that. Just path to it with:
example.com/mod/tcontrol/calendario/p1/jh/p2/ert/p3/tyu/p4/hjk The rest of the URL can just be picked out with getParams()
__________________
- xentek |
|
||||
|
Well, from what I can tell in your example code above - you are trying to force a 'default' module URL to fit to a 'mod' module URL. If that's not what you are trying to do, then please repost your code in a readable format.
Try surrounding them in php bbcodes so that it help format it for you.
__________________
- xentek |
|
|||
|
PHP Code:
http://www.example.com/tcontrol/cale.../p3/tyu/p4/hjk PHP Code:
|
|
|||
|
Hi,
Can I ask you why don't use Zend_Controller_Router_Route ?? Code:
$router->addRoute('route1',new Zend_Controller_Router_Route(
'tcontrol/:param1/*',
array(
'module'=>'mod',
'controller' => 'tcontrol',
'action' => 'index',
'param1' => 'action'
)));
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|