Exemplo n.º 1
0
 public function get($id)
 {
     var_dump(__METHOD__);
     $config = $this->getConfig();
     $model = new ArticleModel($config);
     $ret = $model->getById($id);
     var_dump($ret);
 }
Exemplo n.º 2
0
 public function edit()
 {
     $id = I('id', NULL);
     if (!empty($id)) {
         $article = new ArticleModel();
         $articledata = $article->getById($id);
     } else {
         $this->message('请选择编辑对象', __URL__ . '/index');
     }
     $type = new ArticletypeModel();
     $data = $type->select();
     $this->assign('type', $data);
     $this->assign('articledata', $articledata);
     $this->display();
 }
Exemplo n.º 3
0
 /**
  * 文章编辑页面
  */
 function edit()
 {
     $art_id = $_GET['id'];
     if (!empty($art_id)) {
         //获得文章
         $art = new ArticleModel();
         $list = $art->getById($art_id);
         $this->assign('alist', $list);
         //获得单元
         $sec = new SectionModel();
         $list = $sec->order('id')->select();
         $this->assign('slist', $list);
         //获得分类
         $cat = new CategoryModel();
         $list = $cat->select();
         $this->assign('clist', $list);
     }
     $this->display();
 }