Merge branch 'blog-hashtag-filtr' into 'master'

ссылки с тегами



See merge request !48
parents 7cffe250 c27d0efc
...@@ -43,16 +43,21 @@ class PostController extends BaseController ...@@ -43,16 +43,21 @@ class PostController extends BaseController
if(isset(Yii::$app->request->get()["tags"])) if(isset(Yii::$app->request->get()["tags"]))
{ {
$explode = explode(Yii::$app->request->get()["tags"]);
$session = Yii::$app->session; $session = Yii::$app->session;
$session->set('blog_hashtag', null); $session->set('blog_hashtag', null);
foreach ($tag as $tag_id) $explode = explode(',', Yii::$app->request->get()["tags"]);
foreach ($explode as $k => $tag)
{
$explode[$k] = $tag;
}
$tags = PostTag::find()->select('id')->where(['translit' => $explode])->all();
foreach ($tags as $tag)
{ {
$this->actionSetCookie($tag_id); $this->actionSetCookie($tag->id);
} }
} }
else else
......
...@@ -35,6 +35,10 @@ $this->params['breadcrumbs'][] = $this->title; ...@@ -35,6 +35,10 @@ $this->params['breadcrumbs'][] = $this->title;
return Languages::getCurrent()->name; return Languages::getCurrent()->name;
} }
], ],
[
'attribute' => 'translit',
'header' => 'Транслит',
],
[ [
'class' => 'common\components\ColorActionColumn', 'class' => 'common\components\ColorActionColumn',
'template' => '{update} {delete}', 'template' => '{update} {delete}',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment