src/Router.php
protected function setPaths($params)
    {
        if (isset($params['paths']) && $paths = $params['paths']) {
            $this->paths['controllers']	=
                isset($paths['controllers'])
                    ? trim($paths['controllers'], '/')
                    : $this->paths['controllers'];

            $this->paths['middlewares']	=
                isset($paths['middlewares'])
                    ? trim($paths['middlewares'], '/')
                    : $this->paths['middlewares'];
        }

        if (isset($params['namespaces']) && $namespaces = $params['namespaces']) {
            $this->namespaces['controllers'] =
                isset($namespaces['controllers'])
                    ? trim($namespaces['controllers'], '\\') . '\\'
                    : '';

            $this->namespaces['middlewares'] =
                isset($namespaces['middlewares'])
                    ? trim($namespaces['middlewares'], '\\') . '\\'
                    : '';
        }

        if (isset($params['base_folder'])) {
            $this->baseFolder = rtrim($params['base_folder'], '/');
        }

        if (isset($params['main_method'])) {
            $this->mainMethod = $params['main_method'];
        }

        if (isset($params['cache'])) {
            $this->cacheFile = $params['cache'];
        } else {
            $this->cacheFile = realpath(__DIR__ . '/../cache.php');
        }
    }
protected function setPaths($params)
    {
        if (isset($params['paths']) && $paths = $params['paths']) {
            $this->paths['controllers']	=
                isset($paths['controllers'])
                    ? trim($paths['controllers'], '/')
                    : $this->paths['controllers'];

            $this->paths['middlewares']	=
                isset($paths['middlewares'])
                    ? trim($paths['middlewares'], '/')
                    : $this->paths['middlewares'];
        }

        if (isset($params['namespaces']) && $namespaces = $params['namespaces']) {
            $this->namespaces['controllers'] =
                isset($namespaces['controllers'])
                    ? trim($namespaces['controllers'], '\\') . '\\'
                    : '';

            $this->namespaces['middlewares'] =
                isset($namespaces['middlewares'])
                    ? trim($namespaces['middlewares'], '\\') . '\\'
                    : '';
        }

        if (isset($params['base_folder'])) {
            $this->baseFolder = rtrim($params['base_folder'], '/');
        }

        if (isset($params['main_method'])) {
            $this->mainMethod = $params['main_method'];
        }

        if (isset($params['cache'])) {
            $this->cacheFile = $params['cache'];
        } else {
            $this->cacheFile = realpath(__DIR__ . '/../cache.php');
        }
    }
protected function setPaths ( $ params ) { if ( isset ( $ params [ 'paths' ] ) && $ paths = $ params [ 'paths' ] ) { $ this -> paths [ 'controllers' ] = isset ( $ paths [ 'controllers' ] ) ? trim ( $ paths [ 'controllers' ] , '/' ) : $ this -> paths [ 'controllers' ] ; $ this -> paths [ 'middlewares' ] = isset ( $ paths [ 'middlewares' ] ) ? trim ( $ paths [ 'middlewares' ] , '/' ) : $ this -> paths [ 'middlewares' ] ; } if ( isset ( $ params [ 'namespaces' ] ) && $ namespaces = $ params [ 'namespaces' ] ) { $ this -> namespaces [ 'controllers' ] = isset ( $ namespaces [ 'controllers' ] ) ? trim ( $ namespaces [ 'controllers' ] , '\\' ) . '\\' : '' ; $ this -> namespaces [ 'middlewares' ] = isset ( $ namespaces [ 'middlewares' ] ) ? trim ( $ namespaces [ 'middlewares' ] , '\\' ) . '\\' : '' ; } if ( isset ( $ params [ 'base_folder' ] ) ) { $ this -> baseFolder = rtrim ( $ params [ 'base_folder' ] , '/' ) ; } if ( isset ( $ params [ 'main_method' ] ) ) { $ this -> mainMethod = $ params [ 'main_method' ] ; } if ( isset ( $ params [ 'cache' ] ) ) { $ this -> cacheFile = $ params [ 'cache' ] ; } else { $ this -> cacheFile = realpath ( __DIR__ . '/../cache.php' ) ; } }
Set paths and namespaces for Controllers and Middlewares.

@param array $params

@return void
Set paths and namespaces for Controllers and Middlewares .