pesto / yii2-path-behavior
Automatic generation url path for the model while saving model/
Package info
github.com/Pesto-kun/yii2-path-behavior
Type:yii2-extension
pkg:composer/pesto/yii2-path-behavior
0.1.0
2016-04-01 10:56 UTC
Requires
This package is not auto-updated.
Last update: 2026-03-07 01:39:41 UTC
README
Behavior для генерации URL адреса модели при сохранении.
Install
Выполните команду
$ php composer.phar require pesto/yii2-path-behavior "*"
или добавьте
"pesto/yii2-path-behavior": "*"
в секцию require вашего composer.json файла.
Usage
Теперь можно в методе behaviors() модели указать:
public function behaviors() { return [ ... [ 'class' => PathBehavior::className(), 'fieldName' => 'path', //Поле для генерации пути 'fromFieldName' => 'title' //Поле, за основу которого берется строка ] ... ]; }