abstract:controller/Index.phpcontroller/Index.php
select()->toArray(); $this->view->slides = $slides; //头牌人选 $product = new ProductModel(); $products = $product->where('sort','1')->select()->toArray(); $this->view->products = $products; //新上花魁 $NewProduct = $product->where('sort','2')->limit(1)->select()->toArray(); $this->view->NewProduct = $NewProduct; //查询最新资讯 $new = new NewsModel(); $news = $new->limit(2)->select()->toArray(); $this->view->news = $news; //渲染首页模板 return $this->fetch(); } public function about() { $system = new SystemModel(); $systems = $system->select()->toArray(); $this->view->systems = $systems; return $this->fetch(); } public function product() { $product = new ProductModel(); $products = $product->order('id','desc')->paginate(4); $this->view->products = $products; return $this->fetch(); } public function news() { //实例化模型 $new = new NewsModel(); //查询数据按照id的顺序进行查询并且每页4条数据 $news = $new->order('id','desc')->paginate(4); //给摸板赋值 $this->view->news = $news; //热门新闻 $hotNew = $new->limit(1)->select()->toArray(); $this->view->hotNews = $hotNew; //最新发布 $newNews = $new->limit(6)->select()->toArray(); $this->view->newNews = $newNews; return $this->fetch(); } public function ConNew() { $newId = Request::param('id'); $new = NewsModel::get($newId); $this->view->new = $new; //热门新闻 $hotNew = $new->limit(1)->select()->toArray(); $this->view->hotNews = $hotNew; //最新发布 $newNews = $new->limit(6)->select()->toArray(); $this->view->newNews = $newNews; //渲染首页模板 return $this->fetch(); } public function ConPro() { //获取产品id $ProId = Request::param('id'); $product = ProductModel::get($ProId); $this->view->product = $product; //渲染首页模板 return $this->fetch(); } }public/style.html
public/head.html
public/floor.html
view/about.html
xxx — 关于我们 {include file="public/style"}{include file="public/head"}{volist name="systems" id="system"}{include file="public/floor"}关于我们
{$system.about_title}
{$system.about_content}
{/volist}{$system.ci_title}
{$system.ci_content}
百年老店
本着一心为客官服务的心做事、我们这里拥有十分美貌的姑娘和周到完美的服务!
view/news.html
xxx — 新闻中心 {include file="public/style"}{include file="public/head"}{include file="public/floor"}新闻中心
{volist name="news" id="new"}
- {/volist}
{$new.title}
{$new.time|date="Y-m-d"}{$new.desc}
阅读更多{$news|raw}view/index.html
xxx — 首页 {include file="public/style"} {include file="public/head"}view/con_new
xxx — 新闻详细 {include file="public/style"}{include file="public/head"}新闻详细
{$new.title}
{$new.time|date="Y-m-d"}{:htmlspecialchars_decode($new.content)}
Popular Entries
- opcache_get_status
88852browse
- strcmp
61123browse
- Zip
36921browse
- phpinfo
29467browse
- fgetcsv
28772browse
- JavaScript,JS
27202browse
- String,字符串
25045browse
- Object,对象
24683browse
- margin-top
24527browse
- readline
24310browse