Hi
I was wondering if there was a better way to get module/action from a
routing label other than this way:
...
/**
* Retrieves the module and action from a routing label
*
* @param string $route
* @return array ($module, $action)
*/
public static function getModActFromRoute($routeName)
{
// turn the route into a module and action, and return them
$routes = sfContext::getInstance()->getRouting()->getRoutes();
$route = $routes[$routeName]->getDefaults();
$module = $route['module'];
$action = $route['action'];
return array($module, $action);
}
...
We have a very big routing.yml and I am wondering if there is a
performance hit getting "all" the routes when we only want one.
$routes = sfContext::getInstance()->getRouting()->getRoutes();
$route = $routes[$routeName]->getDefaults();
Is there any way to do something like this (which does not work for me):
$route =
sfContext::getInstance()->getRouting()->getRoutes()[$routeName]->getDefaults();
Any thoughts are appreciated.
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---