deepn9x/yii2-env

DOT-ENV

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.1 2024-01-29 10:21 UTC

This package is auto-updated.

Last update: 2024-04-29 12:56:25 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");