项目作者: yii2-bridge

项目描述 :
Yii2 Bridge Slug Behavior
高级语言: PHP
项目地址: git://github.com/yii2-bridge/slug-behavior.git
创建时间: 2018-06-07T04:24:45Z
项目社区:https://github.com/yii2-bridge/slug-behavior

开源协议:

下载


Yii2 Bridge Slug Behavior

Yii2 bridge slug behavior

This code is inspired by https://github.com/zelenin/yii2-slug-behavior, with correction of errors related to the Kazakh language.
Full documentation about this behavior, you can read on the above repository.

Installation

Composer

The preferred way to install this extension is through Composer.

Either run composer require yii2-bridge/slug-behavior:^0.1

or add "yii2-bridge/slug-behavior": "^0.1" to the require section of your composer.json

Using

Attach the behavior in your model:

  1. public function behaviors()
  2. {
  3. return [
  4. 'slug' => [
  5. 'class' => 'Bridge\Slug\BridgeSlugBehavior',
  6. 'slugAttribute' => 'slug',
  7. 'attribute' => 'title',
  8. // If intl extension is enabled, see http://userguide.icu-project.org/transforms/general.
  9. 'transliterateOptions' => 'Russian-Latin/BGN; Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC;'
  10. ],
  11. ];
  12. }

Author

Altynbek Kazezov, e-mail: altinbek__97@mail.ru