Welcome Guest, Not a member yet? Register   Sign In
Using dynamic menus with Codeigniter?
#1

[eluser]Solarpitch[/eluser]
Hi,

I have this little problem I'm trying to figure out. I have a tabular menu in my header.php file. Anytime a page is selected the style of the tab will change (ie. the tab will be highlighted for that specific page)

I simply use class='active' and class='nonactive' to define which tab should be highlighted.

eg: if the user was on the home page...

<a href = 'index' class = 'active'>
<a href = 'contact' class = 'nonactive'>
<a href = 'about' class = 'nonactive'>

I need to find a way of telling the header.php file which function in the controller is being displayed so the header can assign 'active' to the appropriate link.

Something like the following, but obviously this wont work... Big Grin

Code:
function index()
    {
                $data['tab'] = 'active';
        $this->load->view('template/header', $data);

        $this->load->view('pages/index');
        $this->load->view('template/footer');
    }


Messages In This Thread
Using dynamic menus with Codeigniter? - by El Forum - 01-04-2009, 03:36 PM
Using dynamic menus with Codeigniter? - by El Forum - 01-04-2009, 11:57 PM
Using dynamic menus with Codeigniter? - by El Forum - 01-05-2009, 02:39 AM
Using dynamic menus with Codeigniter? - by El Forum - 01-05-2009, 03:05 AM
Using dynamic menus with Codeigniter? - by El Forum - 01-05-2009, 07:59 AM
Using dynamic menus with Codeigniter? - by El Forum - 01-05-2009, 08:55 AM
Using dynamic menus with Codeigniter? - by El Forum - 01-05-2009, 09:04 AM
Using dynamic menus with Codeigniter? - by El Forum - 01-05-2009, 09:20 AM
Using dynamic menus with Codeigniter? - by El Forum - 01-05-2009, 09:30 AM
Using dynamic menus with Codeigniter? - by El Forum - 01-05-2009, 09:35 AM
Using dynamic menus with Codeigniter? - by El Forum - 01-06-2009, 12:15 PM
Using dynamic menus with Codeigniter? - by El Forum - 01-06-2009, 04:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB