public function components($components = null)
    {
        if ($components === null && $this->_components === null) {
            $this->_components = new ComponentRegistry($this);
        }
        if ($components !== null) {
            $components->setController($this);
            $this->_components = $components;
        }

        return $this->_components;
    }
public function components($components = null)
    {
        if ($components === null && $this->_components === null) {
            $this->_components = new ComponentRegistry($this);
        }
        if ($components !== null) {
            $components->setController($this);
            $this->_components = $components;
        }

        return $this->_components;
    }
public function components ( $ components = null ) { if ( $ components === null && $ this -> _components === null ) { $ this -> _components = new ComponentRegistry ( $ this ) ; } if ( $ components !== null ) { $ components -> setController ( $ this ) ; $ this -> _components = $ components ; } return $ this -> _components ; }
Get the component registry for this controller.

If called with the first parameter, it will be set as the controller $this->_components property

@param \Cake\Controller\ComponentRegistry|null $components Component registry.

@return \Cake\Controller\ComponentRegistry
Get the component registry for this controller .