Construct function runs first when main class/controller called by the user.It runs even before the index method.

Initialization :

parent::__construct();


Example:


public function __construct()
{
     
       parent::__construct();
       //Your method or code goes here
}