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

mapAction() public method

Map action to an internal request type.
public mapAction ( string $action, string | array $config = [], boolean $enable = true ) : void
$action string The Controller action to provide an implementation for.
$config string | array Config array or class name like Crud.Index.
$enable boolean Should the mapping be enabled right away?
return void
    public function mapAction($action, $config = [], $enable = true)
    {
        if (is_string($config)) {
            $config = ['className' => $config];
        }
        $action = Inflector::variable($action);
        $this->config('actions.' . $action, $config);
        if ($enable) {
            $this->enable($action);
        }
    }