/** * @inheritdoc */ public function init() { if ($this->routePrefix === null) { $this->routePrefix = $this->prefix; } $this->prefix = trim($this->prefix, '/'); $this->routePrefix = trim($this->routePrefix, '/'); parent::init(); }
/** * @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(); }