页面内容自己用SQL语句提取并显示
页面内容自己用SQL语句提取并显示,如页面中,ID为5,提取该页面信息并显示。
$result=Db::name('portal_post')->where('id',5)->find();
$content= htmlspecialchars_decode($result['post_content']);
$this->assign('content',$content);
return $this->fetch(':info');
说明:
内容输出时,html标签也输出,需要使用htmlspecialchars_decode()这个方法进行处理后输出。