zhangdi / yii2-env
The env extension for Yii2
Installs: 41
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >= 7.0
- yiisoft/yii2: ~2.0.10
This package is auto-updated.
Last update: 2024-12-13 22:01:04 UTC
README
Env extension for Yii 2
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist zhangdi/yii2-env
or add
"zhangdi/yii2-env": "*"
to the require section of your composer.json.
Usage
<?php use ZhangDi\Env\Env; // get raw value $rawValue = Env::get('ENV_NAME', 'default value'); // get bool value, second argument is default value $boolValue = Env::getBoolean('ENV_NAME', false); // get int value, second argument is default value $intValue = Env::getInt('ENV_NAME', 0);