I have a menu of page selection whose final appearance (the current page highlighted with a different color) should be generated dynamically because I want to reuse the same menu for countless pages, how will I make this dynamic markup?
Image of how the menu should be (with the page that I'm highlighting):
HTMLcoderenderedfromthestaticmenu:
<divid="left_sidebar" class="col-md-2">
<ul class="nav nav-pills nav-stacked">
<li role="presentation" class="active"><a href="dashboard.php">Dashboard
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="hardware-statistics.php">Hardware Statistics
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="hardware-logs.php">Hardware Logs
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="software-statistics.php">Softwares Statistics
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="software-logs.php">Softwares Logs
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="site-statistics.php">Site Statistics
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="site-logs.php">Site Logs
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="advertises-statistics.php">Advertises Statistics
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="advertises-logs.php">Advertises Logs
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="notices-warnings-errors.php">Notices, Warnings and Errors
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
</ul>
</div>
Note that I make the page highlight that I am through a class
OBS1: I'm using a Template Engine Dwoo Template 2.0
to generate the application's interface (including the menu).
OBS2: I'm using PHP
to create the data that is passed to the data array (data that is passed to the dwoo object for html fill).