<?php $currentUrl = Mage::helper('core/url')->getCurrentUrl(); // get current url
<?php $url = $category->getURL(); ?>
<li class="<?php if ($currentUrl == $url) {echo 'active';} else{echo '';} ?> dropdown megamenu-fw "></li>
我想在li標籤上做一個條件,如果當前url等於當前li url然後添加活動類但它不工作。如何使課堂真實?
_but it does not working._這是什麼意思?你看到什麼錯誤? –
上述條件不起作用,這是我的意思 –
它不是通過此代碼添加類 –