html
{$info.title}
{$info.con}
热门评论
{foreach $pl as $k => $vv}
{$vv.con}
{foreach $hpl as $k=>$h}
{if $vv.id == $h.fid}
{$h.con} 回复 {$h.fid}
{/if}
{/foreach}
{/foreach}
controllernamespace home\controller;
use think\controller;
class indexcontroller extends controller {
public function index(){
$info=m('neirong')->find();
$pid=$info['id'];
$pl=m('pinlun')->where(nid = $pid and fid=0)->select();
$hpl=m('pinlun')->where(nid = $pid)->select();
$this->assign(info,$info);
$this->assign(pl,$pl);
$this->assign(hpl,$hpl);
$this->display();
}
public function add(){
$data=i('post.');
$pl=m('pinlun')->add($data);
}表
ad:真正免费,域名+虚机+企业邮箱=0元
