mrstroz/yii2-wavecms
最新稳定版本:0.2.14
Composer 安装命令:
composer require mrstroz/yii2-wavecms
包简介
Yii2 WaveCMS
README 文档
README
Yii2 WaveCMS
It is recommended to install on Yii 2 Advanced Project Template
Installation
The preferred way to install this extension is through composer.
Run
composer require --prefer-source "mrstroz/yii2-wavecms" "~0.2.5"
or add
"mrstroz/yii2-wavecms": "~0.2.5"
to the require section of your composer.json file.
Required steps
- Update
backend/config/main.php(Yii2 advanced template)
'modules' => [ // ... 'wavecms' => [ 'class' => 'mrstroz\wavecms\Module', 'languages' => ['en','pl'] ], ], // ... 'components' => [ // ... 'user' => [ 'identityClass' => 'mrstroz\wavecms\models\User', //Change identity class // ... ], ] // ... 'controllerMap' => [ 'elfinder' => [ 'class' => 'mihaildev\elfinder\Controller', 'access' => ['@'], 'disabledCommands' => ['netmount'], 'roots' => [ [ 'baseUrl'=>'@frontWeb', 'basePath'=>'@frontWebroot', 'path' => 'userfiles', 'name' => 'Files' ] ] ] ]
-
Uncomment
urlManagersection inbackend/config/main.phpand add .htaccess -
Update
common/config/main.php(Yii2 advanced template)
'components' => [ 'authManager' => [ 'class' => 'yii\rbac\DbManager', ], ]
- Run migration
Add the migrationPath in console/config/main.php and run yii migrate:
// Add migrationPaths to console config: 'controllerMap' => [ 'migrate' => [ 'class' => 'yii\console\controllers\MigrateController', 'migrationPath' => [ '@app/migrations', '@yii/rbac/migrations/', '@yii/i18n/migrations/', '@vendor/mrstroz/yii2-wavecms/migrations/', '@vendor/yii2mod/yii2-settings/migrations/' ], ], ],
Or run migrates directly
yii migrate --migrationPath=@yii/rbac/migrations
yii migrate --migrationPath=@yii/i18n/migrations/
yii migrate --migrationPath=@vendor/mrstroz/yii2-wavecms/migrations
yii migrate --migrationPath=@vendor/yii2mod/yii2-settings/migrations
- Update
console/config/main.php(Yii2 advanced template)
'modules' => [ // ... 'wavecms' => [ 'class' => 'mrstroz\wavecms\Module' ], ],
- Add new WaveCMS user
yii wavecms/create [email] [password]
Overriding classes
Classes can be overridden by:
classMapattribute for WaveCMS module
'modules' => [ // ... 'wavecms' => [ 'class' => 'mrstroz\wavecms\Module', 'languages' => ['en','pl'], 'classMap' => [ 'User' => \common\models\User::class ] ], ],
- Yii2 Dependency Injection configuration in
backend/config/main.php
'container' => [ 'definitions' => [ mrstroz\wavecms\models\User::class => common\models\User::class ], ],
Overriding controllers
Use controllerMap attribute for WaveCMS module to override controllers
'modules' => [ // ... 'wavecms' => [ 'class' => 'mrstroz\wavecms\Module', 'languages' => ['en','pl'], 'controllerMap' => [ 'user' => 'backend\controllers\UserController' ] ], ],
Overriding views
Use themes for override views
'components' => [ // ... 'view' => [ 'theme' => [ 'basePath' => '@app/themes/basic', 'baseUrl' => '@web/themes/basic', 'pathMap' => [ '@wavecms/views' => '@app/themes/basic/wavecms', ], ], ], // ... ],
Multilingual
-
Many languages can be handle by yii2-localeurls. Follow all steps from Locale Urls installation.
-
Set CMS languages in
backend/config/main.phpfor WaveCMS module
'modules' => [ // ... 'wavecms' => [ 'class' => 'mrstroz\wavecms\Module', 'languages' => ['en','pl'] ], // ... ]
- Configure message sources see docs
'components' => [ // ... 'i18n' => [ 'translations' => [ '*' => [ 'class' => 'yii\i18n\DbMessageSource', ], ], ], ],
- Use
messagecommand to add translations added in templates
yii message/config-template path/to/config.php
yii message path/to/config.php
Shared hosting
For shared hosting, copy and replace environments folder from vendor/mrstroz/wavecms and type php init. Frontend url: /public, Backend url: /public/admin
Available WaveCMS modules
Page (home page, text pages, menu) - https://github.com/mrstroz/yii2-wavecms-page
Example (example module) - https://github.com/mrstroz/yii2-wavecms-example
Form (form module) - https://github.com/mrstroz/yii2-wavecms-form
INWAVE - Internet Software House
inwave.eu
统计信息
- 总下载量: 448
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-10-11