[eluser]Barber of Padua[/eluser]
So, combining all suggestions the final code is like this:
Ditched the MY_Controller
Code:
class Page extends Controller {
function Page()
{
parent::Controller();
$this->getMainNav('globalmenu');
}
function index()
{
$data = array();
$data['content'] = $this->Pages_model->getPageData('home');
$this->load->vars($data);
$this->load->view('main_layout');
}
function contact()
{
$data = array();
// etc
}
function getMainNav($menu)
{
$data = array();
$data['main_nav'] = $this->Pages_model->getNav($menu);
$this->load->vars($data);
}
}
simpler and cleaner :-)
Thanks for the great feedback, all of you!