[eluser]haloace[/eluser]
I'm new to CI and the MVC style. What's the best way to include a menu on every page? Can I use a ci helper in a class? Basically, I tried to create a class with my menu (using the url helper) and load it in the controller on each page, but it's not working.
//controller function
function index()
{
$this->load->library('Menu');
$menu = new Menu();
$this->load->view('header',$menu);
$this->load->view('home');
$this->load->view('footer',$menu);
}
//class
class Menu {
$this->load->helper('url');
$this->$url['home'] = anchor(base_url(), 'home', array('title' => 'home'));
$this->$url['about'] = anchor('about/', 'about', array('title' => 'about'));
$this->$url['forum'] = anchor('forum/', 'forum', array('title' => 'forum'));
$this->$url['faq'] = anchor('faq/', 'faq', array('title' => 'faq'));
}
Thanks for any help.