kovalin / yii2-mconfig
Yii2 MConfig Module
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
This package is not auto-updated.
Last update: 2024-10-02 21:39:15 UTC
README
Easy Installation
Install with composer
To install with Composer, simply require the latest version of this package.
composer require kovalin/yii2-mconfig "dev-master"
Download and install
Download an archive of MConfig and extract module files it into the /modules/mconfig/ directory your Yii application.
- You can download zip archive https://codeload.github.com/kovalin/yii2-mconfig/zip/master
Install with git
From the command line, switch to the /modules directory your Yii application and run the following commands:
git clone https://github.com/kovalin/yii2-mconfig.git mv yii2-mconfig mconfig
Configuration
Database Migrations
Before using Comments Widget, we'll also need to prepare the database.
php yii migrate --migrationPath=modules/mconfig/migrations
Config your Yii app
Once the extension is installed, simply modify your application configuration as follows:
return [ 'components' => [ 'MConfig' => [ 'class' => 'app\modules\mconfig\components\MConfig' ], 'modules' => [ 'mconfig' => [ 'class' => 'app\modules\mconfig\Module', ] ], ];
Usage
You can use this code in any place of your app.
Yii::$app->MConfig->get('adminEmail');