Esempio n. 1
0
 /**
  * @inheritdoc
  */
 public function createUrl($manager, $route, $params)
 {
     if ($this->routePrefix === '' || strpos($route, $this->routePrefix . '/') === 0) {
         return parent::createUrl($manager, $route, $params);
     } else {
         return false;
     }
 }
Esempio n. 2
0
 /**
  * @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();
 }