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 38 return [
39 39 'slug' => [
40 40 'class' => SlugBehavior::className(),
41   - 'action' => 'article/view',
  41 + 'action' => 'blog/article',
42 42 'params' => [
43 43 'id' => 'blog_article_id',
44 44 ],
... ...
models/CategoryLang.php
... ... @@ -32,7 +32,7 @@
32 32 return [
33 33 'slug' => [
34 34 'class' => SlugBehavior::className(),
35   - 'action' => 'blog-category/view',
  35 + 'action' => 'blog/category',
36 36 'params' => [
37 37 'id' => 'blog_category_id',
38 38 ],
... ...
models/TagLang.php
... ... @@ -35,7 +35,7 @@
35 35 return [
36 36 'slug' => [
37 37 'class' => SlugBehavior::className(),
38   - 'action' => 'tag/view',
  38 + 'action' => 'blog/tag',
39 39 'params' => [
40 40 'id' => 'blog_tag_id',
41 41 ],
... ...
views/blog-tag/_form_language.php
1 1 <?php
2 2  
  3 + use artbox\core\helpers\SlugifyDecorator;
3 4 use artbox\core\models\Language;
4 5 use artbox\weblog\models\ArticleLang;
5 6 use yii\web\View;
... ... @@ -12,5 +13,12 @@
12 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 ]); ?>
... ...