2011-06-04 145 views
1

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "C:\xampp\htdocs\eventos\libs\templates\teste.tpl" on line 9 "Ola! {$names}, bem vindo ao Smarty!" unknown tag "private_print_expression"' in C:\xampp\htdocs\eventos\libs\sysplugins\smarty_internal_templatecompilerbase.php:441 Stack trace: #0 C:\xampp\htdocs\eventos\libs\sysplugins\smarty_internal_templatecompilerbase.php(263): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown tag "pr...', 9) #1 C:\xampp\htdocs\eventos\libs\sysplugins\smarty_internal_templateparser.php(2338): Smarty_Internal_TemplateCompilerBase->compileTag('private_print_e...', Array, Array) #2 C:\xampp\htdocs\eventos\libs\sysplugins\smarty_internal_templateparser.php(2846): Smarty_Internal_Templateparser->yy_r28() #3 C:\xampp\htdocs\eventos\libs\sysplugins\smarty_internal_templateparser.php(2946): Smarty_Internal_Templateparser->yy_reduce(30) #4 C:\xampp\htdocs\eventos\libs\sysplugins\smarty_internal_smartytemplatecompiler.php(51): Smart in C:\xampp\htdocs\eventos\libs\sysplugins\smarty_internal_templatecompilerbase.php on line 441錯誤Smarty的 - 致命錯誤:未捕獲的異常

我的PHP代碼

<?php 
include('includes/header.html'); 
include('conf/conf.php'); 
require_once(SMARTY_DIR.'Smarty.class.php'); 
$smarty = new Smarty(); 

$smarty->template_dir = 'C:\xampp\htdocs\eventos\libs\templates'; 
$smarty->compile_dir = 'C:\xampp\htdocs\eventos\libs\templates_c'; 
$smarty->config_dir = 'C:\xampp\htdocs\eventos\libs\configs'; 
$smarty->cache_dir = 'C:\xampp\htdocs\eventos\libs\cache'; 

$smarty->assign('name','Ned'); 

$smarty->display('teste.tpl'); 
?> 

和我的智能代碼(teste.tpl)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Untitled Document</title> 
</head> 

<body> 
Ola! {$name}, bem vindo ao Smarty! 
</body> 
</html> 

回答

1

變化

$smarty->assign('name','Ned'); 

$smarty->assign('names','Ned'); 
+1

不,它不是! =/ – Gabriel 2011-06-04 04:12:47

+0

你用什麼smarty版本?和其他信息?使用prestashop?要麼? – royrui 2011-06-04 04:27:18

相關問題