2017 © Pedro Peláez
 

yii2-extension yii2-ya-slug

Yii2 yandex slug

image

skeeks/yii2-ya-slug

Yii2 yandex slug

  • Wednesday, July 4, 2018
  • by skeeks-semenov
  • Repository
  • 1 Watchers
  • 0 Stars
  • 721 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 26 % Grown

The README.md

Yii2 yandex slug (Semantic URL)

This solution allows you to generate good slug urls. (slug wiki)., (*1)

Direct generation is engaged in a proven solution cocur/slugify., (*2)

Transliteration yandex http://translit-online.ru/yandex.html, (*3)

Latest Stable Version Total Downloads, (*4)

Installation

The preferred way to install this extension is through composer., (*5)

Either run, (*6)

php composer.phar require --prefer-dist skeeks/yii2-ya-slug "*"

or add, (*7)

"skeeks/yii2-ya-slug": "*"

How to use

behavior

Attach the behavior in your model:, (*8)

public function behaviors()
{
    return [
        'slug' => [
            'class' => 'skeeks\yii2\yaslug\YaSlugBehavior',
            'slugAttribute' => 'slug',                      //The attribute to be generated
            'attribute' => 'name',                          //The attribute from which will be generated
            // optional params
            'maxLength' => 64,                              //Maximum length of attribute slug
            'minLength' => 3,                               //Min length of attribute slug
            'ensureUnique' => true,
        ]
    ];
}

helper

echo skeeks\yii2\yaslug\YaSlugBehavior::slugify("Тестовая строка");

Demo (view urls)


skeeks!
SkeekS CMS (Yii2) — fast, simple, effective!
skeeks.com | cms.skeeks.com, (*9)

The Versions

04/07 2018

dev-master

9999999-dev https://skeeks.com/

Yii2 yandex slug

  Sources   Download

BSD-3-Clause GPL-3.0+

The Requires

 

by Semenov Alexander

yii2 yii behavior slug

04/07 2018

1.0.1

1.0.1.0 https://skeeks.com/

Yii2 yandex slug

  Sources   Download

BSD-3-Clause

The Requires

 

by Semenov Alexander

yii2 yii behavior slug

08/11 2017

1.0.0

1.0.0.0 https://skeeks.com/

Yii2 yandex slug

  Sources   Download

GPL-3.0+

The Requires

 

by Semenov Alexander

yii2 yii behavior slug