behaviors\SluggableBehavior validateSlug()

validateSlug() protected method Checks if given slug value is unique. protected boolean validateSlug ( $slug )$slug string Slug value return boolean Whether slug is unique.

behaviors\TimestampBehavior $createdAtAttribute

$createdAtAttribute public property The attribute that will receive timestamp value Set this property to false if you do not want to record the creation time. public string $createdAtAttribute = 'created_at'

behaviors\SluggableBehavior isNewSlugNeeded()

isNewSlugNeeded() protected method (available since version 2.0.7) Checks whether the new slug generation is needed This method is called by getValue() to check whether the new slug generation is needed. You may override it to customize checking. protected boolean isNewSlugNeeded ( )

behaviors\SluggableBehavior init()

init() public method Initializes the object. This method is invoked at the end of the constructor after the object is initialized with the given configuration. public void init ( )

behaviors\SluggableBehavior generateSlug()

generateSlug() protected method This method is called by getValue() to generate the slug. You may override it to customize slug generation. The default implementation calls yii\helpers\Inflector::slug() on the input strings concatenated by dashes (-). protected string generateSlug ( $slugParts )$slugParts array An array of strings that should be concatenated and converted to generate the slug value. return string The conversion result.

behaviors\SluggableBehavior getValue()

getValue() protected method Returns the value for the current attributes. This method is called by evaluateAttributes(). Its return value will be assigned to the attributes corresponding to the triggering event. protected mixed getValue ( $event )$event yii\base\Event The event that triggers the current attribute updating. return mixed The attribute value

behaviors\SluggableBehavior generateUniqueSlug()

generateUniqueSlug() protected method Generates slug using configured callback or increment of iteration. protected string generateUniqueSlug ( $baseSlug, $iteration )$baseSlug string Base slug value $iteration integer Iteration number return string New slug value throws yii\base\InvalidConfigException

behaviors\SluggableBehavior $immutable

$immutable public property (available since version 2.0.2) Whether to generate a new slug if it has already been generated before. If true, the behavior will not generate a new slug even if $attribute is changed. public boolean $immutable = false

behaviors\SluggableBehavior $slugAttribute

$slugAttribute public property The attribute that will receive the slug value public string $slugAttribute = 'slug'

behaviors\SluggableBehavior $uniqueValidator

$uniqueValidator public property Configuration for slug uniqueness validator. Parameter 'class' may be omitted - by default yii\validators\UniqueValidator will be used. See also yii\validators\UniqueValidator. public array $uniqueValidator = []