2017 © Pedro Peláez
 

yii2-extension yii2-slug-behavior

yii2 slug behavior

image

seacjs/yii2-slug-behavior

yii2 slug behavior

  • Friday, December 16, 2016
  • by seacjs
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yii2 slug behavior

Yii2 slug behavior, (*1)

Installation

Composer

The preferred way to install this extension is through Composer., (*2)

Either run php composer.phar require seacjs/yii2-slug-behavior "*", (*3)

or add "seacjs/yii2-slug-behavior": "*" to the require section of your composer.json, (*4)

Using

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

public function behaviors()
{
    return [
        'slug' => [
            'class' => 'seacjs\behaviors\Slug',
            'slugAttribute' => 'slug',
            'attribute' => 'name',
            'translit' => true,
        ]
    ];
}

or use another class Sluggable, work with transliteration, (*6)

Sluggable extends SluggableBehavior, (*7)

public function behaviors()
{
    return [
        'slug' => [
            'class' => 'seacjs\behaviors\Sluggable',
            'slugAttribute' => 'slug',
            'attribute' => 'name',
        ]
    ];
}

The Versions

16/12 2016

dev-master

9999999-dev

yii2 slug behavior

  Sources   Download

MIT

The Requires

 

by Avatar Evgeny

extension yii2 behavior slug seacjs