I’ve written a couple of Controllers that implement an interface, so it has to be loaded before the Controller is loaded. What’s the standard place to early load dependencies in Codeigniter?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Simply add a
require_onceat the top of the controller that loads the interface. You can’t use the default CodeIgniter autoload as it doesn’t support interfaces. While you could add therequire_oncelines at the top of./config/autoload.php, I would suggest adding it in each controller as follows: