Browse Source

Improve sluggable behavior documentation (#13747) [skip ci]

tags/2.0.12
Nikolay Oleynikov 8 years ago committed by Alexander Makarov
parent
commit
ad1ce9e498
  1. 8
      framework/behaviors/SluggableBehavior.php

8
framework/behaviors/SluggableBehavior.php

@ -65,12 +65,14 @@ class SluggableBehavior extends AttributeBehavior
*/ */
public $slugAttribute = 'slug'; public $slugAttribute = 'slug';
/** /**
* @var string|array the attribute or list of attributes whose value will be converted into a slug * @var string|array|null the attribute or list of attributes whose value will be converted into a slug
* or `null` meaning that the `$value` property will be used to generate a slug.
*/ */
public $attribute; public $attribute;
/** /**
* @var string|callable the value that will be used as a slug. This can be an anonymous function * @var callable|string|null the value that will be used as a slug. This can be an anonymous function
* or an arbitrary value. If the former, the return value of the function will be used as a slug. * or an arbitrary value or null. If the former, the return value of the function will be used as a slug.
* If `null` then the `$attribute` property will be used to generate a slug.
* The signature of the function should be as follows, * The signature of the function should be as follows,
* *
* ```php * ```php

Loading…
Cancel
Save