<?php // +---------------------------------------------------------------------- // | bronet [ 以客户为中心 以奋斗者为本 ] // +---------------------------------------------------------------------- // | Copyright (c) 2013-2017 http://www.bronet.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: 老猫 <bronet@126.com> // +---------------------------------------------------------------------- namespace app\portal\controller; use cmf\controller\HomeBaseController; use app\portal\model\PortalCategoryModel; class ListController extends HomeBaseController { public function index() { $id = $this->request->param('id', 0, 'intval'); $portalCategoryModel = new PortalCategoryModel(); $category = $portalCategoryModel->where('id', $id)->where('status', 1)->find(); $this->assign('category', $category); $listTpl = empty($category['list_tpl']) ? 'list' : $category['list_tpl']; return $this->fetch('/' . $listTpl); } }