App\Controller\AppController::initialize PHP Method

initialize() public method

Use this method to add common initialization code like loading components. e.g. $this->loadComponent('Security');
public initialize ( ) : void
return void
    public function initialize()
    {
        parent::initialize();
        $this->loadComponent('RequestHandler');
        $this->loadComponent('Flash');
        /*
         * Enable the following components for recommended CakePHP security settings.
         * see http://book.cakephp.org/3.0/en/controllers/components/security.html
         */
        //$this->loadComponent('Security');
        //$this->loadComponent('Csrf');
    }

Usage Example

 public function initialize()
 {
     parent::initialize();
     $this->loadComponent('RequestHandler');
     $this->loadComponent('Paginator');
     $this->loadComponent('Excel');
 }
All Usage Examples Of App\Controller\AppController::initialize