Yii2 WaveCMS
It is recommended to install on Yii 2 Advanced Project Template
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.
- 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
urlManager
section inbackend/config/main.php
and 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]
Classes can be overridden by:
classMap
attribute 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
],
],
Use controllerMap
attribute for WaveCMS module to override controllers
'modules' => [
// ...
'wavecms' => [
'class' => 'mrstroz\wavecms\Module',
'languages' => ['en','pl'],
'controllerMap' => [
'user' => 'backend\controllers\UserController'
]
],
],
Use themes for override views
'components' => [
// ...
'view' => [
'theme' => [
'basePath' => '@app/themes/basic',
'baseUrl' => '@web/themes/basic',
'pathMap' => [
'@wavecms/views' => '@app/themes/basic/wavecms',
],
],
],
// ...
],
-
Many languages can be handle by yii2-localeurls. Follow all steps from Locale Urls installation.
-
Set CMS languages in
backend/config/main.php
for WaveCMS module
'modules' => [
// ...
'wavecms' => [
'class' => 'mrstroz\wavecms\Module',
'languages' => ['en','pl']
],
// ...
]
- Configure message sources see docs
'components' => [
// ...
'i18n' => [
'translations' => [
'*' => [
'class' => 'yii\i18n\DbMessageSource',
],
],
],
],
- Use
message
command to add translations added in templates
yii message/config-template path/to/config.php
yii message path/to/config.php
For shared hosting, copy and replace environments
folder from vendor/mrstroz/wavecms
and type php init
. Frontend url: /public
, Backend url: /public/admin
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