Welcome Guest, Not a member yet? Register   Sign In
Set a default variable in my controller constructor
#1

[eluser]sohei[/eluser]
Hi all,
I have some variables that appears often in my controller.
So I want to define them in my constructor:
Code:
function __construct()
        {
            parent::__construct();
$this->load->model('artist_model');
            $data['works'] = $this->artist_model->getWorks(8);
        }
But when I call them in my view, it doesn't work.. Can anyone tell me why?

Thanks,
sohei


Messages In This Thread
Set a default variable in my controller constructor - by El Forum - 02-06-2011, 08:56 PM
Set a default variable in my controller constructor - by El Forum - 02-06-2011, 10:13 PM
Set a default variable in my controller constructor - by El Forum - 02-08-2011, 04:03 PM
Set a default variable in my controller constructor - by El Forum - 02-09-2011, 11:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB