k1low/darumaotoshi

为 CakePHP 3 的“存档和删除”(滑动删除)插件

资助包维护!
k1LoW

安装: 5

依赖: 0

建议者: 0

安全性: 0

星标: 1

关注者: 2

分支: 0

公开问题: 0

类型:cakephp-plugin

v1.1.0 2016-08-29 09:25 UTC

This package is auto-updated.

Last update: 2024-09-06 09:07:14 UTC


README

だるま落とし

为 CakePHP 3 的“存档和删除”(滑动删除)插件

安装

$ composer require k1low/darumaotoshi

启用插件

$ bin/cake plugin load Darumaotoshi

加载所需的数据库表

$ bin/cake migrations migrate --plugin Darumaotoshi

用法

// in the initialize() method
$this->addBehavior('Darumaotoshi.Darumaotoshi');

级联删除

如果你希望在删除父项目时将相关记录标记为已删除,只需将行为附加到相关表类中,并在表关系中设置 'dependent' => true, 'cascadeCallbacks' => true 选项。

代码参考

UseMuffin/Trash

版权所有 (c) 2015, Use Muffin,许可协议为 MIT 许可证

许可证

在 MIT 许可证下。