Op Tuesday 19 May 2009 22:04:04 schreef Tom Shaw:
> I'm using the array config Zend Application setup. My array router resource
> setup is below. Here are the problems the first route "entry" is a
> correctly designed route. But when I try to access it Zend Controller
> Router Exception throws an exception that the title is not defined. This is
> a simple route that should not require any extra parameters. Second If I
> add a single static route as in the default-flash route. Zend Navigation
> completely breaks and none of the links work. There's obviously serious
> issues concerning how Zend Navigation/Router/Application are working
> together here. *Note* I have gotten this to work and that is by defining
> every single route the system has + defining in Zend Navigation a route for
> every single page link has which becomes utterly redundant and un
> manageable.
>
>
>
> <?php
>
> return array(
>
>     'entry' => array(
>
>         'type'  => 'Zend_Controller_Router_Route',
>
>         'route' => 'entry/:title',
>
>         'defaults' => array(
>
>             'module'     => 'default',
>
>             'controller' => 'index',
>
>             'action'     => 'index'
>
>         )
>
>     ),
>
>     'tags' => array(
>
>         'type'  => 'Zend_Controller_Router_Route',
>
>         'route' => 'tag/:tag',
>
>         'defaults' => array(
>
>             'module'     => 'default',
>
>             'controller' => 'index',
>
>             'action'     => 'tag',
>
>                                 'tag'        => '\d+'
>
>         )
>
>     ),
>
>     'admin-users-edit' => array(
>
>         'type'  => 'Zend_Controller_Router_Route',
>
>         'route' => 'admin/users/edit/:id',
>
>         'defaults' => array(
>
>             'module'     => 'admin',
>
>             'controller' => 'users',
>
>             'action'     => 'edit',
>
>                                 'id'         => '\d+'
>
>         )
>
>     ),
>
>     'default-flash' => array(
>
>         'type'  => 'Zend_Controller_Router_Route_Static',
>
>         'route' => 'flash',
>
>         'defaults' => array(
>
>             'module'     => 'default',
>
>             'controller' => 'flash',
>
>             'action'     => 'index'
>
>         )
>
>     ),
>
> );
>
>
>
> Tom Shaw
>
> [email protected]

Hi Tom,
For your first concern: add a defaults entry for the parameter. I had the same 
issue and put an extra element into the array, saying 'title' will be null by 
default. See also the manual at 
http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.add-
config

For your second concern: I have already called that option at this list about 
one week ago, but didn't get any response: http://www.nabble.com/Bring-the-
router-and-navigation-closer-together-td23499342ef16154.html#a23499342
I'm thinking of extending the Zend_Controller_Router_Route for accepting a 
Zend_Navigation_Page instance and/or extending the 
Zend_Controller_Router_Rewrite for accepting Zend_Navigation_Container 
objects. Or something like that (the direct implementation doesn't sound that 
good to me).
But then it's easy to create a sitemap according to the 
Zend_Navigation_Container and immediately all navigation elements are ready to 
configured as routes.

Regards, Jurian
--
Jurian Sluiman
Soflomo.com

Reply via email to