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

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



See merge request !48
parents 7cffe250 c27d0efc
......@@ -43,16 +43,21 @@ class PostController extends BaseController
if(isset(Yii::$app->request->get()["tags"]))
{
$explode = explode(Yii::$app->request->get()["tags"]);
$session = Yii::$app->session;
$session->set('blog_hashtag', null);
$explode = explode(',', Yii::$app->request->get()["tags"]);
foreach ($explode as $k => $tag)
{
$explode[$k] = $tag;
}
$session = Yii::$app->session;
$session->set('blog_hashtag', null);
$tags = PostTag::find()->select('id')->where(['translit' => $explode])->all();
foreach ($tag as $tag_id)
foreach ($tags as $tag)
{
$this->actionSetCookie($tag_id);
$this->actionSetCookie($tag->id);
}
}
else
......
......@@ -35,6 +35,10 @@ $this->params['breadcrumbs'][] = $this->title;
return Languages::getCurrent()->name;
}
],
[
'attribute' => 'translit',
'header' => 'Транслит',
],
[
'class' => 'common\components\ColorActionColumn',
'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