https://github.com/cornernote/yii2-cache-behavior
Cache behavior for Yii2.
https://github.com/cornernote/yii2-cache-behavior
Last synced: 4 months ago
JSON representation
Cache behavior for Yii2.
- Host: GitHub
- URL: https://github.com/cornernote/yii2-cache-behavior
- Owner: cornernote
- License: other
- Created: 2016-09-21T07:41:30.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-29T00:47:02.000Z (about 7 years ago)
- Last Synced: 2025-02-28T03:42:20.260Z (5 months ago)
- Language: PHP
- Size: 41 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Yii2 Cache Behavior
[](https://github.com/cornernote/yii2-cache-behavior/tags)
[](LICENSE.md)
[](https://travis-ci.org/cornernote/yii2-cache-behavior)
[](https://scrutinizer-ci.com/g/cornernote/yii2-cache-behavior/code-structure)
[](https://scrutinizer-ci.com/g/cornernote/yii2-cache-behavior)
[](https://packagist.org/packages/cornernote/yii2-cache-behavior)Cache behavior for Yii2.
## Installation
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
$ composer require cornernote/yii2-cache-behavior "*"
```or add
```
"cornernote/yii2-cache-behavior": "*"
```to the `require` section of your `composer.json` file.
## Usage
In your ActiveRecord class:
```php
public function behaviors() {
return [
\cornernote\cachebehavior\CacheBehavior::className(),
// or
[
'class' => \cornernote\cachebehavior\CacheBehavior::className(),
'cache' => 'cache',
'backupCache' => 'fileCache',
],
];
}
```