2017 © Pedro Peláez
 

yii2-extension yii2-wavecms

Yii2 WaveCMS

image

mrstroz/yii2-wavecms

Yii2 WaveCMS

  • Monday, July 23, 2018
  • by mrstroz
  • Repository
  • 1 Watchers
  • 1 Stars
  • 159 Installations
  • CSS
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 12 Versions
  • 24 % Grown

The README.md

yii2-wavecms

Yii2 WaveCMS, (*1)

It is recommended to install on Yii 2 Advanced Project Template, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Run, (*4)

composer require --prefer-source "mrstroz/yii2-wavecms" "~0.2.5"

or add, (*5)

"mrstroz/yii2-wavecms": "~0.2.5"

to the require section of your composer.json file., (*6)

Required steps

  1. 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'
            ]
        ]
    ]
]

  1. Uncomment urlManager section in backend/config/main.php and add .htaccess, (*7)

  2. Update common/config/main.php (Yii2 advanced template), (*8)

'components' => [
    'authManager' => [
        'class' => 'yii\rbac\DbManager',
    ],
]

  1. Run migration

Add the migrationPath in console/config/main.php and run yii migrate:, (*9)

// 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, (*10)

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
  1. Update console/config/main.php (Yii2 advanced template)
'modules' => [
    // ...
    'wavecms' => [
        'class' => 'mrstroz\wavecms\Module'
    ],
],
  1. Add new WaveCMS user
yii wavecms/create [email] [password]

Overriding classes

Classes can be overridden by: 1. classMap attribute for WaveCMS module, (*11)

'modules' => [
    // ...   
    'wavecms' => [
        'class' => 'mrstroz\wavecms\Module',
        'languages' => ['en','pl'],
        'classMap' => [
            'User' => \common\models\User::class
        ]
    ],
],
  1. 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, (*12)

'modules' => [
    // ...   
    'wavecms' => [
        'class' => 'mrstroz\wavecms\Module',
        'languages' => ['en','pl'],
        'controllerMap' => [
            'user' => 'backend\controllers\UserController'
        ]
    ],
],

Overriding views

Use themes for override views, (*13)

'components' => [
    // ...
    'view' => [
        'theme' => [
            'basePath' => '@app/themes/basic',
            'baseUrl' => '@web/themes/basic',
            'pathMap' => [
                '@wavecms/views' => '@app/themes/basic/wavecms',
            ],
        ],
    ],
    // ...
],

Multilingual

  1. Many languages can be handle by yii2-localeurls. Follow all steps from Locale Urls installation., (*14)

  2. Set CMS languages in backend/config/main.php for WaveCMS module, (*15)

'modules' => [
    // ...
    'wavecms' => [
        'class' => 'mrstroz\wavecms\Module',
        'languages' => ['en','pl']
    ],
    // ...
]
  1. Configure message sources see docs
'components' => [
    // ...
    'i18n' => [
        'translations' => [
            '*' => [
                'class' => 'yii\i18n\DbMessageSource',
            ],
        ],
    ],
],
  1. Use message command 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, (*16)

Available WaveCMS modules

Page (home page, text pages, menu) - https://github.com/mrstroz/yii2-wavecms-page, (*17)

Example (example module) - https://github.com/mrstroz/yii2-wavecms-example, (*18)

Form (form module) - https://github.com/mrstroz/yii2-wavecms-form, (*19)

INWAVE LOGO
INWAVE - Internet Software House
inwave.eu, (*20)

The Versions