src/Controller/Component/CrudComponent.php
protected function _loadAction($name)
    {
        if (!isset($this->_actionInstances[$name])) {
            $config = $this->getConfig('actions.' . $name);

            if (empty($config)) {
                throw new ActionNotConfiguredException(sprintf('Action "%s" has not been mapped', $name));
            }

            $className = App::className($config['className'], 'Action', 'Action');
            if (empty($className)) {
                throw new MissingActionException('Could not find action class: ' . $config['className']);
            }

            $this->_actionInstances[$name] = new $className($this->_controller);
            unset($config['className']);
            $this->_actionInstances[$name]->setConfig($config);
        }

        return $this->_actionInstances[$name];
    }
protected function _loadAction($name)
    {
        if (!isset($this->_actionInstances[$name])) {
            $config = $this->getConfig('actions.' . $name);

            if (empty($config)) {
                throw new ActionNotConfiguredException(sprintf('Action "%s" has not been mapped', $name));
            }

            $className = App::className($config['className'], 'Action', 'Action');
            if (empty($className)) {
                throw new MissingActionException('Could not find action class: ' . $config['className']);
            }

            $this->_actionInstances[$name] = new $className($this->_controller);
            unset($config['className']);
            $this->_actionInstances[$name]->setConfig($config);
        }

        return $this->_actionInstances[$name];
    }
protected function _loadAction ( $ name ) { if ( ! isset ( $ this -> _actionInstances [ $ name ] ) ) { $ config = $ this -> getConfig ( 'actions.' . $ name ) ; if ( empty ( $ config ) ) { throw new ActionNotConfiguredException ( sprintf ( 'Action "%s" has not been mapped' , $ name ) ) ; } $ className = App :: className ( $ config [ 'className' ] , 'Action' , 'Action' ) ; if ( empty ( $ className ) ) { throw new MissingActionException ( 'Could not find action class: ' . $ config [ 'className' ] ) ; } $ this -> _actionInstances [ $ name ] = new $ className ( $ this -> _controller ) ; unset ( $ config [ 'className' ] ) ; $ this -> _actionInstances [ $ name ] -> setConfig ( $ config ) ; } return $ this -> _actionInstances [ $ name ] ; }
Load a CrudAction instance.

@param string $name The controller action name.
@return \Crud\Action\BaseAction
@throws \Crud\Error\Exception\ActionNotConfiguredException
@throws \Crud\Error\Exception\MissingActionException
Load a CrudAction instance .