时间:2021-07-01 10:21:17 帮助过:22人阅读
$mod=M("user");
$mod -> getlist(10);
IndexController:
//获取浏览最多文章
$datanews = getreadmore();
$this->assign('data',$datanews);
$tag_morenew = $this->fetch('Public:tag_morenew');
$this->assign('tag_morenew',$tag_morenew);
//微博秀
$tag_weiboshow = $this->fetch('Public:tag_weiboshow');
$this->assign('tag_weiboshow',$tag_weiboshow);
$this->display();
tpl:相对应的模板解析
tag_morenew.html
tag_weiboshow.html
tpl下的index.html
{$tag_header}
{$main}
{$tag_article}
{$newtype}
{$tag_morenew}
{$tag_weiboshow}
{$tag_footer}