i have a problem similar to this question
How to identify active menu link in CakePHP
i have a page in my default.ctp file in which i want to add 'active' class on links. how can i identify the current url of the page and then apply the class on link.. i have followed the answer also there which is
$url = $this->Html->url('INPUT_THE_URL') ;
$active = $this->request->here == $url? true: false;
i dont know how can i do this in my code .. sorry for asking as i am newbie in cakephp .. here is my code
**default.ctp file**
<li>
<?php echo $this->Html->link('Dashboard', array('controller'=>'users','action' => 'controlpanel'), array('title' => 'Dashboard','class' => 'shortcut-dashboard'));?></li>
<li> <?php echo $this->Html->link('Contacts', array('controller'=>'contacts','action' => 'index'), array('title' => 'Contacts','class' => 'shortcut-contacts'));?></li>
i want to add a class with li like this
<li class = 'active''>