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条件


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM