在SAE中用SMARTY无法include共同文件

#1 tidiar

我在smarty模板中,有一个index.html。

其中大部分网页有共同的头,则使用 <{include file="head.inc"}>

报如下的错误:Smarty Error: Syntax Error in template "/data1/www/htdocs/469/dakuai/2/tpl/index.html" on line 12 "<{include_php file="head.inc" }>" - Unexpected " }>", expected one of: "}>" , " "


请各位大侠给看看。

2011-06-10 11:29:06

#2 tidiar

纯粹从字面上看, 这个错误完全莫名奇妙。
“ }> ” 我重复输入多次。 去掉include这个部分后,页面上其他的内容一切显示正常。

2011-06-10 11:35:59

#3 tidiar

另外说明:同样的语法,在非sae版本下运行正常。

2011-06-10 11:39:20

#4 jake

smarty 3对语法检查很严格。和sae环境没关。

<{include_php file="head.inc" }> 错误在于后面的}>有空格了。

<{include_php file="head.inc"}> 才是正确的语法

2011-06-10 12:32:44