[url=http://website.local/controller/action]http://website.local/controller/action[/url] Uri::segment(1) -> "controller" Uri::segment(2) -> "action"
<li<?php if(Uri::segment(1) == 'welcome') echo ' class="selected"'; ?>><?php echo Html::anchor('welcome', 'Home'); ?></li>
Davide Bellini wrote on Tuesday 9th of August 2011:Try to use the Uri::segment() method.
[url=http://website.local/controller/action]http://website.local/controller/action[/url] Uri::segment(1) -> "controller" Uri::segment(2) -> "action"
so ...
<li<?php if(Uri::segment(1) == 'welcome') echo ' class="selected"'; ?>><?php echo Html::anchor('welcome', 'Home'); ?></li>
echo Html::nav(array('welcome', 'posts:create'));
It looks like you're new here. If you want to get involved, click one of these buttons!