09-03-2009, 02:28 AM
[eluser]pyrokinesis[/eluser]
Thanks for the reply Dam1an,
How about if I do this then?
It doesn't seem to work either,
I'm trying to set up a default value that is set in the constructor and passed passed to every view unless overwritten from within the specific controller.
Thanks for the help
Thanks for the reply Dam1an,
How about if I do this then?
Code:
<?php
class Sample_Controller extends Controller {
public function __construct() {
parent::__construct();
$this->data['active_menu'] = 'Menu One';
}
public function function_one() {
$this->data['page_title'] = 'Sample Page Title';
//$data['active_menu'] is passed to the main view
$this->load->view($this->main_view, $this->data);
}
public function function_two() {
$this->data['page_title'] = 'Another Page Title';
//Override the default $data['active_menu'] value
$this->data['active_menu'] = 'new value';
$this->load->view($this->main_view, $this->data);
}
}
It doesn't seem to work either,
I'm trying to set up a default value that is set in the constructor and passed passed to every view unless overwritten from within the specific controller.
Thanks for the help
