undefinedor/yii2-cached-active-record

The cached activeRecord for the Yii2 framework

Installs: 1 282

Dependents: 0

Suggesters: 0

Security: 0

Stars: 10

Watchers: 4

Forks: 2

Open Issues: 0

Type:yii2-extension

0.0.3 2016-07-28 10:04 UTC

This package is not auto-updated.

Last update: 2024-12-02 15:00:07 UTC


README

Installation

The preferred way to install this extension is through Composer .

composer require undefinedor/yii2-cached-active-record

Configuration

In order to use CachedActiveRecord, a valid cache component must be enabled. For Example:

    'components' => [
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
    ],

Usage

It's so easy to use ,you just need to use [[undefinedor\yii2\CachedActiveRecord]] For example,

    <?php
    
    namespace common\models;
    
    use undefinedor\yii2\CachedActiveRecord;
    use yii\db\ActiveRecord;
    
    class BaseActiveRecord extends ActiveRecord
    {
        use CachedActiveRecord;
        
        //todo 
    }