Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Smarty变量问题_Php_Smarty - Fatal编程技术网

Php Smarty变量问题

Php Smarty变量问题,php,smarty,Php,Smarty,嘿,我在smarty中分配的变量有问题。 我想将一些值分配给其他模板,但它无法正常工作。问题在于: {{include file="lib/topmenu_item.tpl" onclick="load_from_php('pageBody', '{{$base_url}}index.php/datasources/grouping', 'grouping', this);" node="datasources/grouping" text="Grouping"}} 我想将$base_url的

嘿,我在smarty中分配的变量有问题。 我想将一些值分配给其他模板,但它无法正常工作。问题在于:

{{include file="lib/topmenu_item.tpl" onclick="load_from_php('pageBody', '{{$base_url}}index.php/datasources/grouping', 'grouping', this);" node="datasources/grouping" text="Grouping"}}
我想将$base_url的值添加到url的前面。我该怎么做

Ps:{{和}}是我的分隔符

类似这样的东西:

{{include file="lib/topmenu_item.tpl" onclick="load_from_php('pageBody', '{{' . $base_url. '}}index.php/datasources/grouping', 'grouping', this);" node="datasources/grouping" text="Grouping"}}

使用字符串连接在字符串中使用变量

啊,这在正常情况下是如此微不足道:谢谢!