nueip/yii2-common

Yii 2 Common Lib

Maintainers

Details

github.com/nueip/yii2-common

Source

Installs: 21

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 2

Type:yii2-extension

v1.2.0 2025-07-15 02:28 UTC

This package is auto-updated.

Last update: 2025-07-15 03:03:58 UTC


README

PHP Version Require Latest Stable Version Total Downloads License

Installation

composer require nueip/yii2-common

or include the dependency in the composer.json file:

{
    "require": {
        "nueip/yii2-common": "^1.0"
       
    }
}

Configuration

Optional Use EncryptBehavior

Setting your config file. e.g., /config/web.php

use nueip\yii2\common\base\GuSecurity;

$config = [
    'components' => [
        'security' => [
            'class' => GuSecurity::class,
            'encryptKey' => 'YOUR_ENCRYPT_KEY',
        ]
    ]
]

Setting your models file. e.g., /models/Account.php

use nueip\yii2\common\behaviors\EncryptBehavior;

public function behaviors()
{
    return [
        'encryptAttrs' => [
            'class' => EncryptBehavior::class,
            'attributes' => ['id_number', 'salary_amount'],
        ],
    ];
}