• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 658
  • Last Modified:

Codeigniter Construct Question

On my controller, if I put processes in the __construct () function, do they run each time the controller is ran, regardless of the subfunction ran?

1 Solution

     whatever process or loading libraries or calling library functions you place inside the constructor of a controller its is called for sure everytime when controller is instantinated (the page is refreshed) .  

Constructors are useful if you need to set some default values, or run a default process when your class is instantiated. Constructors can't return a value, but they can do some default work.

If you come out with exactly what you need i can help you more.

Jerome Dennis

juliancaldwellomahaAuthor Commented:
Thanks Jerome!

That completely answered my question.  That helped so much.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now