主页 > 网站建设 > 建站知识 > 织梦runphp=yes标签中怎么调用其他field值

织梦runphp=yes标签中怎么调用其他field值

POST TIME:2021-05-22 23:46

织梦runphp=yes标签中调用其他field值的方法

织梦的标签里可以通过runphp=yes的方式来执行php代码,但有些时候我们需要在一个标签的runphp=yes中调用其他的field值来作为条件,那么该如何做呢?

上网搜索了下,以下办法可以实现:

用全局变量来解决

 
{dede:php}$GLOBALS['xxoo']=$refObj->Fields['fieldname']{/dede:php}

{dede:field.xxxx runphp="yes"}@me="test".@me."-test".$GLOBALS['xxoo'];{/dede:field.xxxx}

即,先开一个PHP的标签,把想赋的值替换给global变量。然后在另外的运行中将field值赋值给他。



收缩
  • 微信客服
  • 微信二维码
  • 电话咨询

  • 400-1100-266