Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cornernote/yii2-cache-behavior
Cache behavior for Yii2.
https://github.com/cornernote/yii2-cache-behavior
Last synced: 3 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 (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-29T00:47:02.000Z (over 6 years ago)
- Last Synced: 2024-10-15T12:52:29.546Z (4 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
[![Latest Version](https://img.shields.io/github/tag/cornernote/yii2-cache-behavior.svg?style=flat-square&label=release)](https://github.com/cornernote/yii2-cache-behavior/tags)
[![Software License](https://img.shields.io/badge/license-BSD-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/cornernote/yii2-cache-behavior/master.svg?style=flat-square)](https://travis-ci.org/cornernote/yii2-cache-behavior)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/cornernote/yii2-cache-behavior.svg?style=flat-square)](https://scrutinizer-ci.com/g/cornernote/yii2-cache-behavior/code-structure)
[![Quality Score](https://img.shields.io/scrutinizer/g/cornernote/yii2-cache-behavior.svg?style=flat-square)](https://scrutinizer-ci.com/g/cornernote/yii2-cache-behavior)
[![Total Downloads](https://img.shields.io/packagist/dt/cornernote/yii2-cache-behavior.svg?style=flat-square)](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',
],
];
}
```