Settings Module ¶
Settings for multilanguage, multidomain site
Installation ¶
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist koperdog/yii2-sitemanager "*"
or add
"koperdog/yii2-sitemanager": "*"
to the require section of your composer.json
file.
Add the component to your common config:
...
'components' => [
// ...
'settings' => [
'class' => 'koperdog\yii2sitemanager\components\Settings',
],
// ...
]
...
also you should add component to bootstrap config:
...
'bootstrap' => ['settings'],
...
and add the module to backend config:
'modules' => [
'manager' => [
'class' => 'koperdog\yii2sitemanager\Module',
],
],
Then start the migration (console):
`
php
php yii migrate --migrationPath=@vendor/koperdog/yii2-sitemanager/migrations
`
Usage ¶
Once the extension is installed, simply use it in your code by :
autoloaded settings:
`
php
\Yii::$app->params['setting_name'];
`
If you are not sure if the setting is autoload:
`
php
\Yii::$app->settings->get('setting_name');
`
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.