ZF-7994: Zend_Controller_Router_Route does not work with URL view helper if passing in an array of values
Description
I am creating a URL like so:
$this->view->url(array('sort' => array('param1','param2'));
Notice the array of params for 'sort'. This works fine when I am using the standard router. If I use my own router, I always get an error:
$router->addRoute('controlleralias', new Zend_Controller_Router_Route(
':module/mycontrolleralias/:action/*',
array(
'module' => 'mymodule',
'controller' => 'mycontroller',
'action' => 'myaction'
)
));
urlencode() expects parameter 1 to be string, array given
#0 [internal function]: __lambda_func(Array)
#1 /library/Zend/Controller/Router/Route.php(398): urlencode(Array, false, true)
#2 /library/Zend/Controller/Router/Rewrite.php(441): Zend_Controller_Router_Route->assemble(Array, NULL, false, true)
#3 /library/Zend/View/Helper/Url.php(49): Zend_Controller_Router_Rewrite->assemble(Array)
If I do NOT use an array of params, my custom router works fine:
$this->view->url(array('sort' => 'param1'));
I have concluded that this is a bug in Zend_Controller_Router_Route, that it does not support arrays being used as values when assembling the URLs.
Comments
No comments to display