#1 okbb
教程里有个smarty的留言板,但是没有show详细的页显示,于是我自己依胡画瓢,加了个show.html213
main.php里面加了个
function show(){ // 这里是查看留言内容
$id = $this->spArgs("id"); // 用spArgs接收spUrl传过来的ID
$guestbook = spClass("guestbook"); // 还是用spClass
$condition = array('id'=>$id); // 制造查找条件,这里是使用ID来查找属于ID的那条留言记录
$this->$g= $guestbook->find($condition); // 这次是用find来查找,我们把$condition(条件)放了进去
$this->display("{$tpl}/show.html");
}
index.php改成
<{foreach from=$results item=one}>
<{$one.contents}>
<{/foreach}>
为什么进到show.php一片空白,啥都没。。。
2010-08-04 14:56:35