有谁知道我该如何检查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