gunter1020 / yii2-common
Yii 2 Common Lib
Installs: 4 242
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- php: >=8.1
- ramsey/uuid: ^4.1
- yii2tech/ar-softdelete: ^1.0
- yiisoft/yii2: ^2.0
Requires (Dev)
- nunomaduro/phpinsights: ^2.6
README
Installation
composer require gunter1020/yii2-common
or include the dependency in the composer.json
file:
{ "require": { "gunter1020/yii2-common": "^1.0" } }
Configuration
Optional
Use EncryptBehavior
Setting your config file.
e.g., /config/web.php
use gunter1020\yii2\common\base\GuSecurity; $config = [ 'components' => [ 'security' => [ 'class' => GuSecurity::class, 'encryptKey' => 'YOUR_ENCRYPT_KEY', ] ] ]
Setting your models file.
e.g., /models/Account.php
use gunter1020\yii2\common\behaviors\EncryptBehavior; public function behaviors() { return [ 'encryptAttrs' => [ 'class' => EncryptBehavior::class, 'attributes' => ['id_number', 'salary_amount'], ], ]; }