framework/rest/UrlRule.php
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();
    }
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();
    }
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 ( ) ; }
{@inheritdoc}
{