ZF-9372: Zend_Rest_Route issues with routing.

Issue Type: Bug Created: 2010-03-08T16:34:11.000+0000 Last Updated: 2012-11-20T21:38:16.000+0000 Status: Open Fix version(s): Reporter: Joseph Crawford (jcrawford) Assignee: None Tags: - Zend_Rest_Route

Related issues: Attachments:


With any of the other Routers you can use them in conjunction with a Front Controller Plugin and hook into the routeShutdown to do any modifications that you need. For some reason Zend_Rest_Router does not return the expected results in the array.

For instance. If I make the request and I use a standard router I get the following array back

array( 'module' => '2.0', 'controller' => 'products', 'action' => 'get' )

However it seems that Zend_Rest_Route validates the module/controller/action against the dispatcher which is something all of the other routes do not seem to do and i get results like the following:

array( 'controller' => '2.0', 'action' => 'get', 'module' => 'default', 'products' => 11 )

In my case I am trying to hook into the routeShutdown() method so that I may change the version number (module) to be m2m0 as you cannot have modules starting with numbers or with periods in them at all.

I have tried using a regular route and chaining it to the rest router but that goes against rest practices and I could not get it to work chaining in either direction.

As a work around I have had to extend Zend_Rest_Route and override the match() method. However due to the nature of how the match method works I unfortunately had to duplicate the entire method:

The only lines I actually changed are lines 32-36.

There should be a way to accomplish this with the Zend_Rest_Route as there is with all of the other routers.


No comments to display

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.