Cake\Controller\Controller::beforeFilter PHP Method

beforeFilter() public method

Called before the controller action. You can use this method to configure and customize components or perform logic that needs to happen before each controller action.
public beforeFilter ( Cake\Event\Event $event ) : Response | null
$event Cake\Event\Event An Event instance
return Cake\Network\Response | null
    public function beforeFilter(Event $event)
    {
        return null;
    }

Usage Example

 public function beforeFilter(Event $event)
 {
     parent::beforeFilter($event);
     //$this->Auth->allow(['view', 'index', 'checkExistence', 'edit',
     //'delete', 'add', 'twit', 'twit1', 'mention','token', 'getMention', 'mentionToDB']);
     $this->Auth->allow(['token', 'getMention']);
 }
All Usage Examples Of Cake\Controller\Controller::beforeFilter