예제 #1
0
 public function getArticleByTypeId()
 {
     $errors = $this->errors;
     //实例化Model
     $articleModel = new ArticleModel();
     //获取所有文章分类
     $allTypes = $articleTypeModel->getCatrgoryByAdminId($_SESSION['admin']['adminId']);
     $allTypes = formatkey($allTypes, 'typeId');
     //设置typeId主键
     $typeId = $_GET['typeId'];
     $result = $articleModel->getArticleByTypeId($typeId);
     $this->assign("articles", $result);
     //文章
     $this->assign("allTags", $allTags);
     //所有文章标签
     $this->assign("allTypes", $allTypes);
     //某人所有文章分类
     $this->assign("pageTitle", $allTypes[$typeId]['typeName'] . "文章");
     $this->display();
 }