![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
相关问题
求助smarty高手 模板tpl可以嵌套不 要是用<{include file="*.tpl"}>
嵌套了的话 为什么
Notice: Undefined index: news in e:\program files\easyphp1-8\www\job1\templates_c\%%22^224^224D2A2F%%1.tpl.php on line 5
1.tpl
<{section name=loop loop=$news}>
>
><{$news[loop].title}>
<{/section}>
1.php
<?
require "config.php";
$sql = "select * from news where type='1'";
$query = mysql_query($sql);
if(mysql_num_rows($query)==0)
{
echo "¶Ô²»ÆðÊý¾Ý¿âÖÐûÓÐÊý¾Ý£¡";
}
while($array1=mysql_fetch_array($query))
{
$array[]=array("id"=>$array1["Id"], "title"=>$array1["title"]);
}
$smarty->assign("news", $array);
$smarty->display("1.tpl");
?>
其中1.tpl被另外的middle.tpl引用
middle.php中用包含1.php吗 怎么解决出现乱码问题
小弟先谢谢了
提问者:zshtom 08-21 15:03
答复

