*/ class ActionResolver { private $action; private $controller; public function __construct($url) { $this->loadFromUrl($url); } /** * Build the helper from the controller className * @param string $extension * @param string $shortname * @return ActionResolver * @throws \ResolverException */ public static function getByControllerName($shortName, $extension) { $url = _url('index', $shortName, $extension); return new static($url); } /** * @throws \ResolverException */ private function loadFromUrl($url) { $route = new Resolver(new common_http_Request($url)); $route->setServiceLocator($this->getServiceLocator()); $this->controller = $route->getControllerClass(); $this->action = $route->getMethodName(); } public function getAction() { return $this->action; } public function getController() { return $this->controller; } /** * @return ServiceLocatorInterface */ public function getServiceLocator() { return ServiceManager::getServiceManager(); } }