[eluser]Unknown[/eluser]
I have a number of vars I'm going to be plugging into $data in each section of this controller. Does anyone know of an easy way to set a global variable just for this controller? Thanks in advance.
Here's the goods:
Code:
<?php
class Gigiem extends Controller {
function index() {
$this->load->model('blog_model');
$this->load->model('work_model');
$this->load->helper('text');
$data = array(
'view' => 'html5',
'css' => array('html5'),
'js' => array('site'),
'static' => 'http://www.mysite.com/static/',
'title' => 'Welcome!',
'posts' => $this->blog_model->getRecent(2),
'projects' => $this->work_model->getRecent(2)
);
$this->load->view('slate', $data);
}
function work() {
$this->load->model('work_model');
$data = array(
'view' => 'work',
'css' => array('html5'),
'js' => array('site'),
'static' => 'http://www.mysite.com/static/',
'title' => 'Previous Work',
'projects' => $this->work_model->getRecent(2)
);
$this->load->view('slate', $data);
}
}