For one, you seem to have a syntax error (as Zend_Controller_Router_Route_Regex
needs to be a string.
Thus, one could think this would work:
$route = call_user_func_array(array('Zend_Controller_Router_Route_Regex', '__construct'), $args);
However, as far as I know, the first element of the array (the first parameter) can either be a string when calling a static class method or an instance of your class for any method. Neither is the case here. Thus, I would just do it this way:
$route = new Zend_Controller_Router_Route_Regex;
call_user_func_array(array('Zend_Controller_Router_Route_Regex', 'setOptions'), $args);
You might have to use array($args)
instead of $args
depending on the type of that variable.
EDIT No, I am wrong. There is no setOptions()
function for the routes. Let me check something...
EDIT2 A rather ugly hack I found in the PHP manual regarding call_user_func_array()
is the following:
$route = new Zend_Controller_Router_Route_Regex;
call_user_func_array(array($route, '__construct'), $args);
However, I did not test this and it might not work (if it can work at all) depending on the implementation of the constructor (Does it accept no parameters being passed to it? Does it just setup the class or are other things done, too?). Please tell me if it worked...