Welcome Guest, Not a member yet? Register   Sign In
How to set "Current" class while using templates
#1

[eluser]trope[/eluser]
I am using templates in my views, by loading a global template:

$this->load->view("template",$data);

but in certain views, such as my HEADER, the view has dynamic content, such as in the code below:

<li class="current"><a href="&lt;?php echo site_url(" title="Dashboard">Dashboard</a></li>
<li><a href="&lt;?php echo site_url('profile');?&gt;" title="My profile">My profile</a></li>
<li ><a href="&lt;?php echo site_url('settings');?&gt;" title="My settings">My settings</a>

as you see, if we are on the DASHBOARD page, then the <li> tag would have the class of "current". If we are on PROFILE page, the that <LI> would have the current class.

How would I implement this?

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB