What's the best place to early load dependencies in Codeigniter -
i've written couple of controllers implement interface, has loaded before controller loaded. what's standard place load dependencies in codeigniter?
simply add require_once
@ top of controller loads interface. can't use default codeigniter autoload doesn't support interfaces. while add require_once
lines @ top of ./config/autoload.php
, suggest adding in each controller follows:
<?php if ( ! defined('basepath')) exit('no direct script access allowed'); require_once apppath . 'controllers/interface.php'; class welcome extends ci_controller { // useful. }
Comments
Post a Comment