织梦一个标签中怎么引用另外一个标签的内容?
推荐学习:织梦cms
织梦DEDECMS一个标签中引用另外一个标签的内容
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{dede:field name=typename runphp=yes}
global $test;
$test = @me;
@me = ;
{/dede:field}
{dede:field name=id runphp=yes}
global $test;
function getnextone($one,$tow){
return $one."-".$tow;
}
$a = getnextone(@me,$test);
@me=;
echo $a;
{/dede:field}
在系统后台->模版->全局标签测试->将代码贴入,选择环境变量为任意一个栏目
说明:
id字段中调用了typename字段的值,为一些模版中的变量传递提供了一个方式,那就是global,将变量设定为全局变量。
以上就是织梦一个标签中怎么引用另外一个标签的内容的详细内容,更多请关注php中文网其它相关文章!