Exemplo n.º 1
0
 /**
  * 添加/编辑分类
  */
 public function action()
 {
     $categoryId = $this->g('id');
     if (empty($categoryId)) {
         $this->assign('method', 'POST');
         if ($parent = $this->g('parent')) {
             $this->assign('category_parent', $parent);
             $this->assign('title', '添加子分类');
         } else {
             $this->assign('title', '添加分类');
         }
         $tree = \Model\Category::getSelectCate(array($parent));
     } else {
         $category = \Model\Category::listCategory($categoryId);
         if (empty($category)) {
             $this->error('分类不存在');
         }
         $tree = \Model\Category::getSelectCate(array($category['category_parent']));
         $this->assign('method', 'PUT');
         $this->assign($category);
         $this->assign('title', '编辑分类');
     }
     $this->assign('model', \Model\ModelManage::modelList());
     $this->assign('tree', $tree);
     $this->layout();
 }
Exemplo n.º 2
0
 /**
  * 模型列表
  */
 public function index()
 {
     $this->assign('list', \Model\ModelManage::modelList());
     $this->assign('title', \Model\Menu::getTitleWithMenu());
     $this->layout();
 }