lithium\net\http\Route::_init PHP Method

_init() protected method

protected _init ( )
    protected function _init()
    {
        parent::_init();
        if (!$this->_config['continue'] && !preg_match('@{:action:.*?}@', $this->_template)) {
            $this->_params += array('action' => 'index');
        }
        if (!$this->_pattern) {
            $this->compile();
        }
        if (isset($this->_keys['controller']) || isset($this->_params['controller'])) {
            $this->_persist = $this->_persist ?: array('controller');
        }
    }

Usage Example

Example #1
0
 protected function _init()
 {
     $this->_config['template'] = '/{:locale:[a-z]+[a-z]+}' . $this->_config['template'];
     $this->_config['params'] += array('locale' => null);
     parent::_init();
 }