/** * @inheritdoc */ public function createUrl($manager, $route, $params) { if ($this->routePrefix === '' || strpos($route, $this->routePrefix . '/') === 0) { return parent::createUrl($manager, $route, $params); } else { return false; } }
/** * @inheritdoc */ public function init() { if (empty($this->controller)) { throw new InvalidConfigException('"controller" must be set.'); } $controllers = []; foreach ((array) $this->controller as $urlName => $controller) { if (is_int($urlName)) { $urlName = $this->pluralize ? Inflector::pluralize($controller) : $controller; } $controllers[$urlName] = $controller; } $this->controller = $controllers; $this->prefix = trim($this->prefix, '/'); parent::init(); }