> -- Andrew Collington <php@amnuts.com> wrote
> (on Thursday, 04 December 2008, 01:58 PM +0000):
>
>> I am trying to have my routes set via a plugin, but even though it seems
>> like the front controller is having the router updated and assigning the
>> router is in the routeStartup method of my plugin, my routes don't seem
>> to work.
>>
>
> What you *can* do, however, is pull the router into your plugin, and add
> routes to it. So, in your code, instead of instantiating a new router
> object, pull it from the front controller:
>
> $router = Zend_Controller_Front::getInstance()->getRouter();
> // now add the routes..
>
>
Many thanks for your help, Matthew and Keith. I'm using Matthew's above
solution and it works wonderfully.
Cheers,
Andy
没有评论:
发表评论