lilhermit / cakephp-plugin-toolkit
此包的最新版本(1.2.8)没有提供许可证信息。
CakePHP-3 的工具箱插件
1.2.8
2021-06-22 10:39 UTC
Requires
- cakephp/cakephp: ^3.3|^4.0
- jdorn/sql-formatter: ^1.2.0
Requires (Dev)
- cakephp/cakephp-codesniffer: ^3.0|~4.0.0
- phpunit/phpunit: ^5.3|^8.5
This package is auto-updated.
Last update: 2024-09-20 20:51:50 UTC
README
此插件包含一个插件中的大量有用内容
安装
- 使用以下命令添加插件,如果您想使用最新版本,将
1.*
替换为dev-master
composer require lilhermit/cakephp-plugin-toolkit:1.*
- 在您的
bootstrap.php
中加载插件
Plugin::load('LilHermit/Toolkit', ['bootstrap' => true]);
SluggableBehavior
在 initialize
方法中使用 $this->addBehavior('LilHermit/Toolkit.Sluggable');
将行为添加到任何表
行为接受以下配置选项
将选项作为数组传递
$this->addBehavior('LilHermit/Toolkit.Sluggable', [
'field' => 'name',
'lowerCase' => true,
'onUpdate' => false
]);