I'm trying to make a generic router to type less when using url helper.
But, the url generated is wrong.

My router:

        $roteadorContato = new Zend_Controller_Router_Route(
            ':language/:contato/'
                ,
            array('language'   => $idiomaSigla
                     ,'module'     => 'SitePrincipal'
                     ,'controller' => 'Contato'
                     ,'action'     => 'index'
                     ,'contato'    => getContato($idiomaSigla)
            )           
        );

In the url i call this: $this->url(array( /*explicit empty!!! */),
'RoteadorContato', false, true);
Result is: http://localhost/
The correct should be: http://localhost/en-us/Contact

But, if I change the router and url helper with redundant attributes, it
works right.

Change the router to: ':language/:contato/*'
Change the url helper: $this->url(array( 'nothing' => 'anything' ),
'RoteadorContato', false, true);
The result: http://localhost/en-us/Contact/nothing/anything

If was not this problem, the router would be perfectly generic for my
purposes.
-- 
View this message in context: 
http://www.nabble.com/Router-with-default-values-in-url-Helper-tp21453519p21453519.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to