public function parse($controller)
{
list($module, $moduleName, $controller, $action) = $this->getPartsFromControllerName($controller);
if (null === $module) {
// this throws an exception if there is no such module
$msg = sprintf('Unable to find controller "%s:%s" - module alias "%s" does not exist.', $moduleName, $controller, $moduleAlias);
} else {
$class = $module->getNamespace() . '\\Controller\\' . $controller;
if (class_exists($class)) {
return $class . '::' . $action . 'Action';
}
$msg = sprintf('Unable to find controller "%s:%s" - class "%s" does not exist.', $moduleName, $controller, $class);
}
throw new \InvalidArgumentException($msg);
}