Skip to content

yiiext/slug-behavior

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slug Behavior

Build Status

Usage

First, import class file, i.g in config

return array(
	'name' => 'My Web Application',

	// ...

	'import' => array(
   		'ext.slug-behavior.SlugBehavior',
    ),
);

Next, attach behavior to model

public function behaviors()
{
	return array(
		array(
			'class' => 'SlugBehavior',
		),
	);
}

Advanced slug, used translator closure, i.g. Transliterator component:

public function behaviors()
{
	return array(
		array(
			'class' => 'SlugBehavior',
			// @link https://github.com/yiiext/transliterator-component
			'translator' => array(Yii::app()->trasliterator, 'transliterate'),
		),
	);
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages