Welcome Guest, Not a member yet? Register   Sign In
Menu views and dynamic or static menu information needed.

Hello ,
I am a newbie with CI. I want to write an application with a sidebar menu and information gathered from mysql database. I want to learn that which is better if menu items wont change much static or dynamic menu.

The other problem is that , I use pages controller to show pages

class Pages extends CI_Controller {

  public function view($page = 'home')
   if ( ! file_exists('application/views/pages/'.$page.'.php'))
    // Whoops, we don't have a page for that!
   $data['title'] = ucfirst($page); // Capitalize the first letter
   $this->load->view('templates/header', $data);
   $this->load->view('pages/'.$page, $data);
   $this->load->view('templates/footer', $data);

This is the menu I want :
Where shall i put the menu controller ? If i use a seperate menu controller , how can i make it shown after header?

what i do is use a different view file and load it using
. or use a function to return the menu. so all you need to do it edit the links and text for the menu in a single place.

Theme © iAndrew 2016 - Forum software by © MyBB