public function checkForRoutedRequests(AkRouter &$Router) { $this->parameters_from_url = $params = $Router->match($this); if (!isset($params['controller']) || !$this->isValidControllerName($params['controller'])) { throw new NoMatchingRouteException('No route matches "' . $this->getPath() . '" with {:method=>:' . $this->getMethod() . '}'); } if (empty($params['action'])) { $params['action'] = 'index'; } if (!$this->isValidActionName($params['action'])) { throw new NoMatchingRouteException('No action was specified.'); } if (!empty($params['module'])) { if (!$this->isValidModuleName($params['module'])) { throw new DispatchException('Invalid module ' . $params['module'] . '.'); } } else { unset($this->_request['module']); } isset($params['module']) ? $this->module = $params['module'] : null; $this->controller = $params['controller']; $this->action = $params['action']; if (isset($params['lang'])) { AkLocaleManager::rememberNavigationLanguage($params['lang']); Ak::lang($params['lang']); } $this->_request = array_merge($this->_request, $params); }
function checkForRoutedRequests(AkRouter &$Router) { $this->parameters_from_url = $params = $Router->match($this); if (!isset($params['controller']) || !$this->isValidControllerName($params['controller'])) { throw new DispatchException('No controller was specified.'); } if (!isset($params['action']) || !$this->isValidActionName($params['action'])) { throw new DispatchException('No action was specified.'); } if (isset($params['module']) && !$this->isValidModuleName($params['module'])) { throw new DispatchException('Invalid module.'); } isset($params['module']) ? $this->module = $params['module'] : null; $this->controller = $params['controller']; $this->action = $params['action']; if (isset($params['lang'])) { AkLocaleManager::rememberNavigationLanguage($params['lang']); Ak::lang($params['lang']); } $this->_request = array_merge($this->_request, $params); }