Provides various official and user-released code examples and code reference. You are welcome to exchange and learn unlimited comments.
Html
{$ Info. title}
{$ Info. con}
Popular comments
{Foreach $ pl as $ k =>$ vv}
{$ Vv. con}
{Foreach $ hpl as $ k =>$ h}
{If $ vv. id = $ h. fid}
{$ H. con} reply {$ h. fid}
{/If}
{/Foreach}
{/Foreach}
Controller
namespace 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);
}
Table
AD: truly free, domain name + VM + enterprise mailbox = 0 RMB