buibr / yii2-config
Yii2 Config file for params.
v1.2.1
2019-08-31 15:54 UTC
Requires
- php: >=7.0
- yiisoft/yii2: >=2.0.6
This package is not auto-updated.
Last update: 2024-11-04 15:27:16 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.