pavlinter/yii2-adm-pages2

Yii2: Adm-Pages 2

Installs: 118

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

v0.1.5 2017-08-12 17:47 UTC

This package is not auto-updated.

Last update: 2024-11-09 19:34:49 UTC


README

Установка

Удобнее всего установить это расширение через composer.

   "pavlinter/yii2-adm-pages2": "*",

Настройка

'modules' => [
    ...
    'adm' => [
        ...
        'modules' => [
            'admpages'
        ],
        ...
    ],
    'admpages' => [
        'class' => 'pavlinter\admpages2\Module',
        'pageLayouts' => [
           'page' => 'Page',
        ],
        'pageRedirect' => [],
        'pageTypes' => [],
        'pageLayout' => '/main',
        'closeDeletePage' => [] //id [2,130]
    ],
    ...
],
'components' => [
    ...
    'urlManager' => [
        ....
        'rules'=>[
            '' => 'admpages/default/main', //OR $config['defaultRoute'] = 'admpages/default/main';
            'page/<alias:([A-Za-z0-9_-])+>' => 'admpages/default/index',
        ],
    ],
    ...
],

Запустить миграцию

yii migrate --migrationPath=@vendor/pavlinter/yii2-adm-pages2/admpages2/migrations

Как использовать

echo Html::a('My-Page',['/admpages/default/index', 'alias' => 'My-Page']);

echo Page::urlToLayout('contact'); //Возращяет ссылку на страницу, где layout contact