ZF-6896: support callback function in Zend_Route config

Issue Type: Improvement Created: 2009-06-03T10:22:20.000+0000 Last Updated: 2009-12-17T17:47:06.000+0000 Status: Resolved Fix version(s): Reporter: Mathieu Delisle (m4d3l) Assignee: Ben Scholzen (dasprid) Tags: - Zend_Controller

Related issues: Attachments:


I would like to build dynamically the reqs parameter.

exemple :

if I have in my config file

resources.router.routes.language.reqs.language = "(fr|en)"

I would be able to do something like

resources.router.routes.language.reqs.language = "function:buildUrlLanguage" or resources.router.routes.language.reqs.language = "class:languageModel->getUrlParam"

and in the function buildUrlLanguage()

<pre class="highlight">
function buildUrlLanguage(){
   $result = $db->fetchAll($db->select()->from(...))
   return "(fr|en)";


Posted by Edward Surov (zooh) on 2009-06-16T06:19:17.000+0000

I think it's much better to create custom route class in your case.

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.