2009年9月27日星期日

Re: [fw-mvc] Some question about static route and view helper url

Thank's for the answer, I'll be careful with that next time.

Lucas

Hector Virgen a écrit :
> That's the correct behavior. If you don't specify a route name (or
> pass in NULL), the url will be based on the route that matched the
> current request. In other words, since the current request matched
> MyRoute and you want to build a url using the default route, you'll
> need to specify that to the helper.
>
> --
> Hector
>
>
> On Thu, Sep 24, 2009 at 2:30 AM, Lucas CORBEAUX
> <lucas.corbeaux@gmail.com <mailto:lucas.corbeaux@gmail.com>> wrote:
>
> Hi there,
>
> I'm working with Zend Framework since many months, but it's the
> first time I really need custom routes, so I used Zend_Application
> to config my router, and it works really well.
>
> My routes are statics, and looks like :
>
> resources.router.routes.myRoute.type =
> "Zend_Controller_Router_Route_Static"
> resources.router.routes.myRoute.route = "my/route"
> resources.router.routes.myRoute.defaults.action = "index"
> resources.router.routes.myRoute.defaults.controller = "myController"
> resources.router.routes.myRoute.defaults.module = "default"
> resources.router.routes.myRoute.defaults.param= "1"
>
> In my view I use a view helper :
>
> $this->url(array(), 'myRoute');
>
> The link appear as /my/route and forward to
> /default/index/myController, that's great. But when I'm using my
> custom route, all url view helper with a null $route value use the
> current route instead of the default... As all my navigation's
> link... And every link in my application forward to
> /default/index/myController.
>
> I just want to know if it's the standard behaviour, and if I need
> to change all my application's link to specificaly use the
> "default" route...
>
> Thanks for help,
> Lucas
>
>

没有评论: