diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 699d48f..dea95c8 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -21,10 +21,11 @@ class Index extends Common { // $sub_category = []; + $current_category = []; if(!empty($this->request->param('category_id'))){ $sub_category = Category::where('pid',$this->request->param('category_id'))->where('type',3)->select(); - + $current_category = Category::find($this->request->param('category_id')); if(empty($this->request->param('sub_category_id'))){ $categorys = [$this->request->param('category_id')]; @@ -52,6 +53,7 @@ class Index extends Common $list_post = $model_post->paginate(); + View::assign('current_category',$current_category); View::assign('sub_category',$sub_category); View::assign('list_post',$list_post); diff --git a/view/admin/category/index.html b/view/admin/category/index.html index c51be21..e92b8b2 100644 --- a/view/admin/category/index.html +++ b/view/admin/category/index.html @@ -55,7 +55,7 @@
查看 - 编辑 + 编辑
删除
diff --git a/view/index/index/index.html b/view/index/index/index.html index 14d8a3d..a1f2a9b 100644 --- a/view/index/index/index.html +++ b/view/index/index/index.html @@ -50,7 +50,11 @@ {/volist} {/notempty} - + {notempty name='$current_category.desc'} +
+
{$current_category.desc}
+
+ {/notempty}
{volist name='list_post' id='post'}