I have a Site Layout with a top nav bar, I need to set the class to active depending on the controller which changes when the user clicks on different pages.
views->index.phtml
<li class='<?php echo (isset($this->controllerName) && $this->controllerName == 'about') ? 'active' : '' ?>'><a href="/about">About Us</a></li>
<li class='<?php echo (isset($this->controllerName) && $this->controllerName == 'services') ? 'active' : '' ?>'><a href="/services">Member Sevices</a></li>
I was hoping that Phalcon had a view function or maybe something I can put in the bootstrap so it worked for all pages with out me having to remember to set the controllerName variable in each Controller manually.