|
整合smarty参考的帖子:http://codeigniter.org.cn/forums/thread-10345-1-1.html
controllers/admin/admin.php文件代码片段:
public function getmenu(){
$this->smarty->display("admin/menu.html");
}
访问:http://localhost/leshop/index.php?d=admin&c=admin&m=getmenu
报错:
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "application/views/templates\admin\menu.html" on line 108 ".menu-item .hover{color:red;font-weight:bold;}" - Unexpected ":", expected one of: "}" , " "' in E:\wamp\www\leshop\application\libraries\smarty\sysplugins\smarty_internal_templatecompilerbase.php:621Stack trace:#0 E:\wamp\www\leshop\application\libraries\smarty\sysplugins\smarty_internal_templateparser.php(3154): Smarty_Internal_TemplateCompilerBase->trigger_template_error()#1 E:\wamp\www\leshop\application\libraries\smarty\sysplugins\smarty_internal_templateparser.php(3219): Smarty_Internal_Templateparser->yy_syntax_error(2, ':')#2 E:\wamp\www\leshop\application\libraries\smarty\sysplugins\smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doParse(2, ':')#3 E:\wamp\www\leshop\application\libraries\smarty\sysplugins\smarty_internal_templatecompilerbase.php(171): Smarty_Internal_SmartyTemplateCompiler->doCompile('<!DOCTYPE html ...' in E:\wamp\www\leshop\application\libraries\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 621
menu.html文件102-108行代码:
<style type="text/css">
.tips {
color: #CC0000;
}
.link {
color: #000099;
}
.menu-item .hover{color:red;font-weight:bold;}
</style>
把 color:red;font-weight:bold; 去掉 就不报错了!
不知道这是为什么?
对我来说感觉有点诡异,或许各位能顺利帮我解决!
|
|