In Symfony, how can I add a 'selected' class to the currently selected page in my navigation?
- by Jon Winstanley
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?