In Symfony, how can I add a 'selected' class to the currently selected page in my navigation?

Posted by Jon Winstanley on Stack Overflow See other posts from Stack Overflow or by Jon Winstanley
Published on 2010-03-24T15:26:36Z Indexed on 2010/03/24 15:53 UTC
Read the original article Hit count: 328

Filed under:
|
|

My navigation is written in the layout.php template

It looks like this:

<ul id="nav">
  <li><a href="item1">Item 1</a></li>
  <li><a href="item1">Item 2</a></li>
  <li><a href="item1">Item 3</a></li>
  <li><a href="item1">Item 4</a></li>
</ul>

What is the best way to get a class="current" on the currently selected page?

© Stack Overflow or respective owner

Related posts about symfony

Related posts about mvc