提交 e440f72a 编写于 作者: xchenhao's avatar xchenhao

add page title

上级 a97d293e
...@@ -12,7 +12,7 @@ use yii\filters\AccessControl; ...@@ -12,7 +12,7 @@ use yii\filters\AccessControl;
use yii\web\HttpException; use yii\web\HttpException;
/** /**
* PostController implements the CRUD actions for Post model. * ArticleController implements the CRUD actions for Post model.
*/ */
class ArticleController extends Controller class ArticleController extends Controller
{ {
...@@ -82,7 +82,7 @@ class ArticleController extends Controller ...@@ -82,7 +82,7 @@ class ArticleController extends Controller
->where(['id' => $model->category_id]) ->where(['id' => $model->category_id])
->scalar(); ->scalar();
$this->view->title = $model->title; $this->view->title = $model->title . ' - 不可思议的博客';
return $this->render('view', [ return $this->render('view', [
'model' => $model, 'model' => $model,
'category_name' => $category_name, 'category_name' => $category_name,
...@@ -139,6 +139,7 @@ class ArticleController extends Controller ...@@ -139,6 +139,7 @@ class ArticleController extends Controller
]), ]),
]; ];
$this->view->title = $category->name . ' - 不可思议的博客';
return $this->render($view_tpl, [ return $this->render($view_tpl, [
'articles' => $articles, 'articles' => $articles,
'category' => $category, 'category' => $category,
...@@ -188,6 +189,8 @@ class ArticleController extends Controller ...@@ -188,6 +189,8 @@ class ArticleController extends Controller
'pageSizeParam' => 'page_size', 'pageSizeParam' => 'page_size',
]), ]),
]; ];
$this->view->title = '搜索页 - 不可思议的博客';
return $this->render('search', [ return $this->render('search', [
'articles' => $articles, 'articles' => $articles,
's' => $s, 's' => $s,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册