getting a urlTo another controller's method should be much more concise, like so...
-
Joshua Paine
ick--just noticed what lighthouse did to my code. But more importantly, the args of strpos are reversed. Let's try this again:
if(strpos($methodName,'::')!==false) { list($controllerName,$methodName) = explode('::',$methodName,2); $controller = new $controllerName($this->application); return $controller->urlTo($methodName); } -
Kris Jordan
- Milestone set to 0.11.1
- State changed from new to resolved
Thanks for the submission - great improvement in the API!
This has been added to the source tree with commit 2c3b1a0.
-
joazito
In order for this to work with arguments I needed to replace this line:
return $controller->urlTo($methodName);
With this below:
return call_user_func_array(array($controller, 'urlTo'), array_merge(array($methodName), $args));
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.