Skip to content

cybercog/yii2-constant-trait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Constant behavior for Yii2

Easy way to extract constants from yii2 model

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist chungachguk/yii2-constant-trait "*"

or add

"chungachguk/yii2-constant-trait": "*"

to the require section of your composer.json file.

Usage

return self::getConstants([
    'prefix' => 'TYPE_',
    'keyPattern' => '{value}',
    'valuePattern' => function($key, $value) {
        return Yii::t('app', ucfirst($value) . ' type');
    },
]);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages