startpl/yii2-sitemanager
Composer 安装命令:
composer require startpl/yii2-sitemanager
包简介
Settings for multilanguage, multidomain site
README 文档
README
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 yii migrate --migrationPath=@vendor/koperdog/yii2-sitemanager/migrations
Usage
Once the extension is installed, simply use it in your code by :
autoloaded settings:
\Yii::$app->params['setting_name'];
If you are not sure if the setting is autoload:
\Yii::$app->settings->get('setting_name');
CRUD and URL config
CRUD settings:
go to /manager
CRUD domains:
go to /manager/domains
CRUD languages:
go to /manager/languages
also, if you want use standart CRUD, you can add to Url rule config:
// ... 'rules' => [ 'manager' => 'manager/default/index', 'manager/<controller:domains|languages>/<action:\w+>' => 'manager/<controller>/<action>', 'manager/<controller:domains|languages>' => 'manager/<controller>/index', 'manager/<action:\w+>' => 'manager/default/<action>', ], // ...
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2019-11-26