首页 > smarty为什么报这个错?css中的错误也关模板引擎的事吗?

smarty为什么报这个错?css中的错误也关模板引擎的事吗?


Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file:F:\phpstudy\WWW\smartys\smarty\templates\intro.html" on line 12 "*{margin:0;padding:0;border:0;}" - Unexpected ":", expected one of: "}" <-- thrown in F:\phpstudy\WWW\smartys\smarty\libs\sysplugins\smarty_internal_templatecompilerbase.php on line 12

原来是因为smarty语法与css语法冲突,都有大括号,把css放到外部文件就好了


这应该是符号问题,你看看是不是有符号缺失或者中文状态的符号


是不是CSS样式的大括号和模板冲突,只要保证样式的大括号都折行就没问题


建议用Smarty时,把界定符修改一下,因为还有可能和javascript冲突。
之前做项目时都是修改为{% %}

$smarty = new Smarty;
$smarty->left_delimiter = '{%';
$smarty->right_delimiter = '%}';

http://www.smarty.net/docs/zh...

【热门文章】
【热门文章】