buibr/yii2-config

Yii2 Config file for params.

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

Type:yii2-extension

v1.2.1 2019-08-31 15:54 UTC

This package is not auto-updated.

Last update: 2024-04-22 12:50:37 UTC


README

Description

It was nightmare for me to use the Yii:$app->params[xxx], and i create ad Config class to do this.

Installation

The preferred way to install this extension is through composer.

To install, either run

$ composer require buibr/yii2config "*"

or add

$ "buibr/yii2config":"*"

to the `require` section of your composer.json file.

Usage

Example if the `params.php` contains this:

    ...
    'mail'=>[
        ...
        'contact'   => 'buibr@....',
        'from_name' => 'Marketing Team',
        ...
    ]
    ...

then:

Config::param('mail.contact');

For every `.` means sub element of array in the params. If this elemet is not found will be returned false.

License

buibr/yii2config is released under the MIT License. See the bundled LICENSE for details.