ZF-6737: Chain Route - separator should be configurable

Issue Type: Improvement Created: 2009-05-20T01:41:18.000+0000 Last Updated: 2012-11-20T20:53:19.000+0000 Status: Closed Fix version(s): Reporter: Carsten Halsband (deim) Assignee: None Tags: - Zend_Controller

Related issues: Attachments:



with the wonderful Application Ressource Zend_Application_Resource_Router I can easily create my routes from config. For Eyample:

<pre class="literal">resources.router.routes.pathroute.type                                  = "Zend_Controller_Router_Route_Regex"
resources.router.routes.pathroute.route                                 = "(.*)"
resources.router.routes.pathroute.defaults.1                            = "/"                                 = "path"

resources.router.routes.pathroute.chains.httpmethod.type                = "My_Route_HttpMethod"
resources.router.routes.pathroute.chains.httpmethod.methods[]           = "PROPFIND"
resources.router.routes.pathroute.chains.httpmethod.methods[]           = "OPTIONS"
resources.router.routes.pathroute.chains.httpmethod.defaults.module     = "webdav"
resources.router.routes.pathroute.chains.httpmethod.defaults.controller = "server"

So far so good.

Now I need to configure the separator between the two routes in chain. In my previous bootstrap code I have done this:

<pre class="literal">$oControllerFront = Zend_Controller_Front::getInstance();
$oPathRoute = new Zend_Controller_Router_Route_Regex(...);
$oHttpMethodRoute = new My_Route_HttpMethod(...);

$sSeparator = ''; // empty separator for the http-method-route
$oControllerFront ->getRouter()->addRoute('pathroute-httpmethod',$oPathRoute ->chain($oHttpMethodRoute ,$sSeparator));

But I can't set the chain-seperator by config. In my Opinion, this depends on the internal method in Zend_Controller_Router_Rewrite -> _addChainRoutesFromConfig(...):

<pre class="literal">if ($route instanceof Zend_Controller_Router_Route_Chain) {
    $chainRoute = clone $route;
} else {
    $chainRoute = $route->chain($childRoute);

In Zend_Controller_Router_Route_Abstract the method chain knows a opt. param for separator. this method should be also declared in the interface Zend_Controller_Router_Route_Interface.

I have seen this ZF-6296 request and I look forward to the refactoring of the Router, maybe this request could be solved when refactoring?


Posted by Rob Allen (rob) on 2012-11-20T20:53:19.000+0000

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.

Have you found an issue?

See the Overview section for more details.


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

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