Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yii2-bridge/slug-behavior
Yii2 Bridge Slug Behavior
https://github.com/yii2-bridge/slug-behavior
bridge slug sluggable slugger yii2
Last synced: 14 days ago
JSON representation
Yii2 Bridge Slug Behavior
- Host: GitHub
- URL: https://github.com/yii2-bridge/slug-behavior
- Owner: yii2-bridge
- Created: 2018-06-07T04:24:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-26T10:36:05.000Z (over 6 years ago)
- Last Synced: 2024-11-09T12:41:34.912Z (2 months ago)
- Topics: bridge, slug, sluggable, slugger, yii2
- Language: PHP
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Yii2 Bridge Slug Behavior
[Yii2](http://www.yiiframework.com) [bridge](https://github.com/naffiq/yii2-bridge) slug behavior
This code is inspired by [https://github.com/zelenin/yii2-slug-behavior](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](https://github.com/zelenin/yii2-slug-behavior).
## Installation### Composer
The preferred way to install this extension is through [Composer](http://getcomposer.org/).
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:
```php
public function behaviors()
{
return [
'slug' => [
'class' => 'Bridge\Slug\BridgeSlugBehavior',
'slugAttribute' => 'slug',
'attribute' => 'title',
// If intl extension is enabled, see http://userguide.icu-project.org/transforms/general.
'transliterateOptions' => 'Russian-Latin/BGN; Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC;'
],
];
}
```## Author
[Altynbek Kazezov](https://github.com/altynbek07/), e-mail: [[email protected]](mailto:[email protected])