【发布时间】:2013-01-16 06:33:07
【问题描述】:
smarty 有点小问题,不知道怎么解决。
这是我的 index.tpl
<body>
{include file='header.tpl'}
{include file='leftmenu.tpl'}
<div id=content>
{include file="news.tpl" }
{include file="rightmenu.tpl"}
</body>
我的问题是这条线
<div id=content>
{include file="news.tpl" }
news.php 是一个应该显示 news.tpl 的文件,因为它是我的新闻系统。
在news.php中,我查询mysql数据库并将结果提供给news.tpl。
但是当我写上面这行时,news.tpl 不知道结果是从哪里来的。
希望有人能提供帮助。
【问题讨论】:
-
您必须将
news.php代码移动到index.php。或者在index.php中包含news.php并且不要在那里定义template tenderer路径..