Smarty If URL Contains

前端 未结 2 1567
[愿得一人]
[愿得一人] 2021-02-20 04:23

Using Smarty Tags I\'d like to determine if an URL contains a word, something like:

{if $smarty.get.page contains \"product.php\"} .....

I know

2条回答
  •  广开言路
    2021-02-20 04:57

    All PHP conditionals and functions are recognized, such as ||, or, &&, and, is_array(), etc.

    {if strpos($smarty.get.page, "product.php") !== false}

提交回复
热议问题