麻辣堂|资源主站|开发论坛|在线手册
首页 Apache Linux Java MySQL 注册帮助 
PHP项目开发组是PHP开发资源网于2007组年建成立的项目开发团队,目前核心开发成员有27人, 项目协作成员8名.下设7个开发组,主要承接大/中型网站项目开发任务。

    由于开发任务较多,人员比较紧张,现面向社会招聘全职或者兼职开发人员,不管你是在校大学生,还是全职开发人员,以及SOHO都可以联系本站,我们可以长期合作,并为您带来丰厚的报酬。
  您现在的位置:PHP开发资源网 > 麻辣堂 > 详细资料
待解决
smarty模板里调用php函数的问题
悬赏分:20 - 2007年08月16日

在模板index.html里有一段: {{php}} show_list('hot','2','5','32','','') {{/php}} 在index.php里有: function show_list($type,$class_id=0,$maxLine='',$subnum='',$dateformat='Y:m:d',$tplname) { $subnum=(int)$subnum; global $smarty; global $db; switch ($type) { case 'hot': if($class_id=='' || $class_id==0){ $where = ''; } else $where="where parent_id='$class_id'"; $smarty->assign("more","list.php?parent_id=".$class_id); if($maxLine=='') $limit=''; elseif(preg_match("/^[0-9]+,[0-9]+$/", $maxLine)){ $sql= "select * from news $where Order by num DESC"; $rs = $db->SelectLimit($sql, $maxLine, 0); if ($rs) { while( $ar = $rs->FetchRow()) { $row[] = array("HotUrl"=>"info.php?id=".$ar['id'], "HotParent_id"=>"&parent_id=".$ar['parent_id'], "HotTopic"=>substr($ar['topic'],0,$subnum), "HotTime"=>date($dateformat,$ar['date'])); // if($tplname=='') //$tplname = '../templates/hot_list.html'; $smarty->assign("hot_list",$row); $smarty->display("../templates/hot_list.html"); } } } break; } } hot_list.html'的代码为: {{section name=loop loop=5}} {{/section}}
{{$hot_list[loop].HotTopic}} {{$more}}
但是hot_list.html'模板没有显示在index.html模板的相应位置,说明没有调用成功,请问是什么问题?谢谢!

提问者:wue   08-16 17:05
答复
路过。。。顺便帮顶:)
回答者:玉米づ冰冻可乐 - 瓦岗村民 8-22 09:10
我也来回答:
不管你有没有帮助我们,瓦岗寨8万村民将感谢你。。。。。

为防止灌水,您需要计算一道数学题: 答案:
32 + 92 = ? 请将计算结果填在上面

 
[]
©2007 PhpRes.COM