我有一点聪明的问题,但不知道如何解决这个问题 .
这是我的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
不知道结果来自哪里 .
希望有人能提供帮助 .
2 回答
你做这样的事情,
Smarty_Data
会帮助你将
news
数组发送到assign
函数 .这将是一个很好的选择 . 您只需添加PHP标记即可包含PHP文件