[eluser]suntrop[/eluser]
Hi there.
I want to have some variables from a config table in my DB. Since I need them everywhere I'm loading them in MY_Controller. But somewhere between the controller and the view they get lost. print_r writes blank array to my screen.
MY_Controller.php [EDIT: code is in constructor]
Code:
$this->load->model('global_model');
$config_db = $this->global_model->get_config_db();
global_model.php
Code:
function get_config_db()
{
$query = $this->db->get('config');
return $query->result_array();
}
Welcome Controller (welcome controller extends public controller which extends MY_controller)
Code:
$data['app_config'] = $this->config_db; // this should come from MY_controller
$data['content'] = 'welcome';
$this->load->view('includes/template_public', $data);
... and in my view:
<pre><?php print_r($app_config); ?></pre>
But all I see is
Array
(
)
How do I access the vars from the MY_Controller in a subset controller?
Hope someone can please help.