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

addListener() public method

This will not load or initialize the listener, only lazy-load it. If $name is provided but no $class argument, the className will be derived from the $name. CakePHP Plugin.ClassName format for $name and $class is supported.
public addListener ( string $name, string $className = null, array $config = [] ) : void
$name string Name
$className string Normal CakePHP plugin-dot annotation supported.
$config array Any default settings for a listener.
return void
    public function addListener($name, $className = null, $config = [])
    {
        if (strpos($name, '.') !== false) {
            list($plugin, $name) = pluginSplit($name);
            $className = $plugin . '.' . Inflector::camelize($name);
        }
        $name = Inflector::variable($name);
        $this->config(sprintf('listeners.%s', $name), compact('className') + $config);
    }