Commit 360fa023e992c469592db96225848b7f399f711f

Authored by Alexey Boroda
1 parent ee588281

-Changed alias schema for blog and added alias field to tag

models/ArticleLang.php
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 return [ 38 return [
39 'slug' => [ 39 'slug' => [
40 'class' => SlugBehavior::className(), 40 'class' => SlugBehavior::className(),
41 - 'action' => 'article/view', 41 + 'action' => 'blog/article',
42 'params' => [ 42 'params' => [
43 'id' => 'blog_article_id', 43 'id' => 'blog_article_id',
44 ], 44 ],
models/CategoryLang.php
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 return [ 32 return [
33 'slug' => [ 33 'slug' => [
34 'class' => SlugBehavior::className(), 34 'class' => SlugBehavior::className(),
35 - 'action' => 'blog-category/view', 35 + 'action' => 'blog/category',
36 'params' => [ 36 'params' => [
37 'id' => 'blog_category_id', 37 'id' => 'blog_category_id',
38 ], 38 ],
models/TagLang.php
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 return [ 35 return [
36 'slug' => [ 36 'slug' => [
37 'class' => SlugBehavior::className(), 37 'class' => SlugBehavior::className(),
38 - 'action' => 'tag/view', 38 + 'action' => 'blog/tag',
39 'params' => [ 39 'params' => [
40 'id' => 'blog_tag_id', 40 'id' => 'blog_tag_id',
41 ], 41 ],
views/blog-tag/_form_language.php
1 <?php 1 <?php
2 2
  3 + use artbox\core\helpers\SlugifyDecorator;
3 use artbox\core\models\Language; 4 use artbox\core\models\Language;
4 use artbox\weblog\models\ArticleLang; 5 use artbox\weblog\models\ArticleLang;
5 use yii\web\View; 6 use yii\web\View;
@@ -12,5 +13,12 @@ @@ -12,5 +13,12 @@
12 * @var View $this 13 * @var View $this
13 */ 14 */
14 ?> 15 ?>
15 -<?= $form->field($model_lang, '[' . $language->id . ']label')  
16 - ->textInput([ 'maxlength' => true ]); ?> 16 +<?= $attributeField = $form->field($model_lang, '[' . $language->id . ']label')
  17 + ->textInput([ 'maxlength' => true ]); ?>
  18 +
  19 +<?= SlugifyDecorator::decorate(
  20 + $form->field($model_lang, '[' . $language->id . ']aliasValue'),
  21 + [ '/alias/slugify' ],
  22 + $attributeField
  23 +)
  24 + ->textInput([ 'maxlength' => true ]); ?>