How could I use call_func_array
to create a new object with a __construct
method (with some not optional arguments).
Here's the code:
$urls = array(
'view' => array(
'view/(\d+)',
array('controller' => 'test', 'action' => 'view'),
array(1 => 'id'),
),
);
foreach ($urls as $name => $args) {
$route = call_user_func_array(Zend_Controller_Router_Route_Regex, $args);
$router->addRoute($name, $route);
}