Welcome Guest, Not a member yet? Register   Sign In
how often will public function __construct() run?
#1

In the top of my controller i have 

public function __construct()

In it I initialize the database, load helpers and libs, get environment variables, and then runs $this->_init(). It seems that _construct (and thus _init) is running multiple times. In init() I initialize fusionAuth. Thus I am doing it multiple times per user. I have have seen this through use of the debugger. For example, every time new method in the controller is called. 

Is this correct? where should I be initializing "system wide" resources?
proof that an old dog can learn new tricks
Reply


Messages In This Thread
how often will public function __construct() run? - by richb201 - 03-16-2021, 11:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB