Welcome Guest, Not a member yet? Register   Sign In
intController() and __construct()
#7

(05-22-2022, 02:43 AM)kenjis Wrote: @dgvirtual `initController()` is called after calling `__construct()`.

`__construct()` is PHP language method that is called (by PHP) when creating an instance.
After instantiation of a controller, CI4 calls `initController()`.

Yep, I could deduce that.

so, could I replace my constructors with an initController() method?

do it like it is done in the BaseController init method: call the method and then call it's parent inside?
PHP Code:
        parent::initController($request$response$logger); 
==

Donatas G.
Reply


Messages In This Thread
intController() and __construct() - by enlivenapp - 07-30-2018, 01:26 PM
RE: intController() and __construct() - by kenjis - 05-22-2022, 02:43 AM
RE: intController() and __construct() - by dgvirtual - 05-22-2022, 11:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB