Hello you all:

I have two routes that match a url with the same apparent pattern, the
difference lies in the $actionRoute, this should only be matched if the
variable :action on it equals 'myaction'.


If I go to /en/mypage/whatever/myaction it goes as expected through
$actionRoute.

If I go to /en/mypage/whatever/blahblah it gets rejected by $actionRoute and
matched by $genRoute.

If I go to /en/mypage/whatever it should be matched by $genRoute but it gets
matched by $actionRoute instead throwing and exception because the action
noactionAction() does not exist.


I don't know what I'm doing wrong, I'd appreciate your help. Thanks.

     $genRoute = new Zend_Controller_Router_Route(
       ':lang/mypage/:var1/:var2', 
       array(
        'lang'   => '',
        'module'  => 'mymodule',
        'controller' => 'index',
        'action'  => 'index',
        'var1'   => 'noone',
        'var2'   => 'no'
       ),
       array(
        'var1'   => '[a-z\-]+?',
        'lang'   => '(es|en|fr|de){1}'
       )
      );
      $actionRoute = new Zend_Controller_Router_Route(
       ':lang/mypage/:var1/:action', 
       array(
        'lang'   => '',
        'module'  => 'mymodule',
        'controller' => 'index',
        'action'  => 'noaction',
        'var1'   => 'noone',
       ),
       array(
        'action'  => '(myaction)+?',
        'var'   => '[a-z\-]+?',
        'lang'   => '(es|en|fr|de){1}',
       )
      );
      $router->addRoute('genroute',$genRoute);
      $router->addRoute('actionroute',$actionRoute);



-- 
View this message in context: 
http://www.nabble.com/Zend_Router-requirements-mismatch-tp25956281p25956281.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to