deepn9x / yii2-env
DOT-ENV
1.0.1
2024-01-29 10:21 UTC
Requires
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2026-03-29 01:02:37 UTC
README
DOT-ENV
Installation
The preferred way to install this extension is through composer.
create .env file to config folder
First add link to composer.json
{
"type": "git",
"url": "https://github.com/deepn9x/yii2-env"
}
Either run
composer require deepn9x/yii2-env
or add
"deepn9x/yii2-env": "1.0"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
<?= \deepn9x\env\dotenv($key); ?>``` or add to web.php in components
'dotenv' => [ 'class' => deepn9x\env\dotenv::class ],
Using examples
$example_1 = Yii::$app->dotenv->key("KEY");
$example_2 = new dotenv("ISP_KEY");