[eluser]woutr_be[/eluser]
I'm fairly new to CodeIgniter, but I'm just learning by doing.
I've overwritten the default CI_Controller in order to load views in my general template, like this:
Code:
class Guest_Controller extends CI_Controller
{
private $body_classes = "guest ";
public function __construct()
{
parent::__construct();
}
public function _output($content)
{
// Load the base template with output content available as $content
$data['content'] = &$content;
echo($this->load->view('templates/html_guest', $data, true));
}
}
I also want to use this to do some extra authentication checks, like some user are only allowed certain controllers.
Now when I use this Guest_Controller, like this:
Code:
class Homepage extends Guest_Controller {
public function __contruct()
{
}
public function index()
{
$data = array(
'title' => 'Homagepage',
'page_title' => 'Test title',
'body_classes' => 'guest home'
);
$this->parser->parse('homepage', $data);
}
}
I now want to add some default string to my "body_class", the one that is defined in my Guest_Controller.
Is there a way to override parser->parse in my Guest_Controller in orde to do so?
This doesn't have to be parser->parse, but I can also just use $this->load->view if it's easier that way.