Dedecms methods for calling other variables in the runphp tag
As we all know, in the dedecms can use PHP, the common method is if else, for example, in template production, we need to judge the source and author, if it is empty, then prompt: No or unknown, sample:
{Dede:field name= ' source ' runphp= ' yes '} if (@me = = "") @me = "" or else @me = "Source:" [email protected]; {/dede:field} |
But what if you want to call other variables in the code above? This afternoon, the fire small series encountered this problem, in the Weave Dream Official forum looked for a bit, now the method is published as follows, we will write the variable as Universal: Array, the code is as follows:
{Dede:field name= ' array ' runphp= ' yes '}if (@me [' source '] = = ') @me = "@me [' Other variables ']"; else @me = "Source:" [email protected][' Sour Ce ']; {/dede:field} |
Fire NET original article, please indicate the link when reprinted.
Go Dedecms methods for calling other variables in the runphp tag