1. Go to this page and download the library: Download ereminmdev/yii2-deleted library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ereminmdev / yii2-deleted example snippets
public function behaviors()
{
return [
[
'class' => DeletedBehavior::class,
'comment' => function (self $model, DeletedBehavior $behavior) {
return 'Модель «' . $model->title . '»';
},
],
];
}
public function actions()
{
return [
'deleted-restore' => [
'class' => 'ereminmdev\yii2\deleted\RestoreAction',
],
];
}