Crud\Controller\Component\CrudComponent::_loadAction PHP Method

_loadAction() protected method

Load a CrudAction instance.
protected _loadAction ( string $name ) : BaseAction
$name string The controller action name.
return Crud\Action\BaseAction
    protected function _loadAction($name)
    {
        if (!isset($this->_actionInstances[$name])) {
            $config = $this->config('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]->config($config);
        }
        return $this->_actionInstances[$name];
    }