[eluser]upstream[/eluser]
Hi,
i normally do this way of initializing common libraries/models/helper used in a controls
Code:
public function index()
{
$this->load->model('my_custom_model','custom');
But i just found another way
Code:
class Hello world extends Controller
{
private $libraries = array();
private $helpers = array();
public function __construct()
{
parent::__construct();
$this->load->library($this->libraries);
$this->load->helpers($this->helpers);
$this->load->model('my_custom_model','custom');
}
is this advisable? any drawbacks?
note:i prefer loading these common functionality within the controls and not in config file for portability of the code.
Thanks for answering