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

beforeFilter() public method

Add self to list of components capable of dispatching an action.
public beforeFilter ( Cake\Event\Event $event ) : void
$event Cake\Event\Event Event instance
return void
    public function beforeFilter(Event $event)
    {
        $this->_action = $this->_controller->request->action;
        $this->_request = $this->_controller->request;
        if (!isset($this->_controller->dispatchComponents)) {
            $this->_controller->dispatchComponents = [];
        }
        $this->_controller->dispatchComponents['Crud'] = true;
        $this->_loadListeners();
        $this->trigger('beforeFilter');
    }