[eluser]randomdriver[/eluser]
Sorry this is my first time with OOP and working with classes so bear with me.
I have a website design that has tabs, when a user is on a certain page I want the tab to be a different color than the rest so they know they are in that section. CodeIgniter.com does this with their main site "Home | Downloads | News"
In the past I would have some php code like:
Code:
$homeTab = $downloadsTab = $newsTab = 'off';
$newsTab = 'on';
This would allow me to turn the tabs off and on. Now with the MVC I am having problems getting the logic to pass from the controller to the view. Can't find a tutorial, anyone have suggestions. I try this and it doesn't work:
Controller Code
Code:
function sentbox()
{
$data['main_content'] = 'sentbox_empty';
$data['activemenu'] = 'sentbox';
$this->load->view('includes/template', $data);
}
View Controller
Code:
<? echo $activemenu; ?>
<?php $this->load->view('includes/header'); ?>
<?php $this->load->view($main_content); ?>
<?php $this->load->view('includes/footer'); ?>
Error I get:
Message: Undefined variable: activemenu