PHPCMS快速建站系列之 pc标签where中如何使用变量

{pc:content action="lists" catid="$catid" where="typeid='$t'" order="id DESC" num="30"}

如上代码,模板解析时,总是把where="typeid='$t'"typeid='$t' 解析成字符串,不会解析$t变量

 

解决方法:

{php $where = "typeid=$t"}
{pc:content action="lists" catid="$catid" where="$where" order="id DESC" num="30"}

用字符串的方式传递where条件

posted @ 2017-01-18 12:12  MY0101  阅读(1884)  评论(0编辑  收藏  举报