1. Go to this page and download the library: Download cornernote/yii2-softdelete 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/ */
cornernote / yii2-softdelete example snippets
public function behaviors() {
return [
\cornernote\softdelete\SoftDeleteBehavior::className(),
// or
[
'class' => \cornernote\softdelete\SoftDeleteBehavior::className(),
'attribute' => 'deleted_time',
'value' => new \yii\db\Expression('NOW()'), // for sqlite use - new \yii\db\Expression("date('now')")
],
];
}
public function behaviors() {
return [
\cornernote\softdelete\SoftDeleteQueryBehavior::className(),
// or
[
'class' => \cornernote\softdelete\SoftDeleteQueryBehavior::className(),
'attribute' => 'deleted_time',
],
];
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.