zhangdi/yii2-env

The env extension for Yii2

Installs: 40

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

0.1.1 2019-08-13 08:56 UTC

This package is auto-updated.

Last update: 2024-05-13 20:52:36 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);