有誰知道我該如何檢查href是否等於當前頁面鏈接在smarty?我想從菜單中添加一個「活動」類到鏈接。 我的代碼是這樣的有誰知道如何檢查href是否等於當前頁面鏈接smarty?
<div id="navigation-menu">
<a href="index.php" class="active">Home</a>
<a href="index.php?page=how_it_works">How it Works</a>
<a href="index.php?page=prices">Prices</a>
</div>
您可以使用'{$ smarty.get.page}' – andlrc