smarty include头文件后赋值问题?
有一个头文件header.php,内容为:
<{$header}>
另有一个主文件main.php内容为:
<html>
<head></head>
<body>
<{include_php file='header.php' }></br>
<{$content}>
</body>
</html>
还有一个代码文件code.php
<?php
.................
................
$tpl->assign('header', '头部');
$tpl->assign('content', '内容');
// 显示模板
$tpl->display('main.php');
?>
运行后
头部文件中的变量没有正确显示值,而是原样显示<{$content}>,
请问是什么原因,如何为页面的公有文件header、footer赋变量值?