smarty模板新手问题:提示在模板中发现未定义函数
模板代码:
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->{include file ='header.tpl'}
<form name="oform" action="index.php" method="post" onsubmit="">
<table border="1" align="center" width="70%" cellpadding="3" cellspacing="0">
<caption><h3>{$tableName}<h3></caption>
<tr>
<td width="20%">姓名:</td><td><input type="string" name="ceshi" {if $wandoujia} value='{$wandoujia}'{/if} /></td>
</tr>
<tr>
<td>测试:</td><td><input type="string" name="ceshi2" /></td>
</tr>
<tr><td colspan="2"><input type="submit" value="查询" /></td></tr>
</table>
</form>
{include file ='footer.tpl'}
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><?php
require_once dirname(__FILE__) . "\include\common.inc.php";
require_once SR_TEMPLATE . "\TemplatesFunction.php";
$smarty = $GLOBALS['smarty'];
$smarty -> assign('title','测试标题');
$smarty -> assign('Version',"2011");
$smarty -> assign('HomePageLink','http://localhost/Matance1.0/');
$smarty -> assign('tableName','标题');
if(isset($_POST['ceshi2'])){
$smarty -> assign('wandoujia',$_POST['ceshi2']);
}
$smarty -> display('index.tpl');
?>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号