uraankhayayaal/yii2-page

Page module for Yii2 with slug

Installs: 262

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Open Issues: 0

Type:yii2-extension

v1.0.2 2022-09-12 04:17 UTC

README

Page module for Yii2 with slug

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist uraankhayayaal/yii2-page "*"

or add

"uraankhayayaal/yii2-page": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply add in your console config:

'controllerMap' => [
    ...
    'migrate' => [
        ...
        'migrationPath' => [
            ...
            '@uraankhayayaal/page/src/migrations',
            ...
        ],
    ],
],

And just run the command:

php yii migrate

Set in common config params:

return [
    /* ... */
    'domain' => 'https://yourdomain.example',
];

Add urls in your backend project:

Url::toRoute('/page/back/index');

Add RBAC roles:

page

Custom view file:

'custom_view_for_modules' => [
    'page_front' => [
        'view' => '@frontend/views/front_page/view',
    ],
],

Add fixtures:

php yii fixture PageMenuItem --namespace='uraankhayayaal\page\tests\fixtures'
php yii fixture PageBlockChart --namespace='uraankhayayaal\page\tests\fixtures'
php yii fixture PageBlock --namespace='uraankhayayaal\page\tests\fixtures'

Add fixtures in docker:

php yii fixture PageMenuItem --namespace='uraankhayayaal\page\tests\fixtures' --interactive=0
php yii fixture PageBlockChart --namespace='uraankhayayaal\page\tests\fixtures' --interactive=0
php yii fixture PageBlock --namespace='uraankhayayaal\page\tests\fixtures' --interactive=0