织梦的标签里可以通过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值赋值给他。