Skip to content
This repository has been archived by the owner on Feb 27, 2020. It is now read-only.

hunter-kaan/yii2-misc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Yii2 misc

Yii2 misc

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist valiant/yii2-misc "*"

or add

"valiant/yii2-misc": "*"

to the require section of your composer.json file.

Usage

SluggableBehavior:

	public function behaviors()
	{
		return [
		    ...
			'slug' => [
				'class' => valiant\yii2\behaviors\SluggableBehavior::className(),
				'from_attribute' => 'name_attribute',
				'to_attribute' => 'slug_attribute',
				'transliteration' => true,
				'unique' => true,
			],
		];
	}