cornernote / yii2-cache-behavior
为Yii2提供的缓存行为。
1.0.3
2018-06-28 07:56 UTC
Requires
- yiisoft/yii2: *
Requires (Dev)
- phpunit/dbunit: ~1.0
- phpunit/phpunit: ~4.0
- scrutinizer/ocular: ~1.3
This package is auto-updated.
Last update: 2024-09-19 18:23:27 UTC
README
为Yii2提供的缓存行为。
安装
安装此扩展的首选方式是通过Composer。
运行以下命令:
$ composer require cornernote/yii2-cache-behavior "*"
或者将以下内容添加到你的composer.json
文件的require
部分:
"cornernote/yii2-cache-behavior": "*"
用法
在你的ActiveRecord类中
public function behaviors() { return [ \cornernote\cachebehavior\CacheBehavior::className(), // or [ 'class' => \cornernote\cachebehavior\CacheBehavior::className(), 'cache' => 'cache', 'backupCache' => 'fileCache', ], ]; }