yii2mod / yii2-cms

Simple CMS extension
MIT License
44 stars 24 forks source link

problem on installing #14

Closed RookieLittle closed 7 years ago

RookieLittle commented 7 years ago

hi, i'm a newbie on yii2. i am kinda confuse on the step of adding the code in the config files. Would you mind to guide me step by step on this?

Sorry for any inconvenient and thank you.

ihorchepurnyi commented 7 years ago

Hi, do you install yii2-basic or advanced?

RookieLittle commented 7 years ago

Hi, i'm using advanced

ihorchepurnyi commented 7 years ago

Install steps:

  1. Install the package: php composer.phar require --prefer-dist yii2mod/yii2-cms "*"

  2. Execute migrations: php yii migrate --migrationPath=@vendor/yii2mod/yii2-cms/migrations

  3. Setup Comments Extension: 3.1 Execute migrations: php yii migrate --migrationPath=@vendor/yii2mod/yii2-comments/migrations 3.2 Add this code to frontend/config/main.php

        'modules' => [
             'comment' => [
                 'class' => 'yii2mod\comments\Module',
             ],
       ]

    3.3 Add this code to backend/config/main.php

      'controllerMap' => [
             'comments' => 'yii2mod\comments\controllers\ManageController',
      ]  
  4. Add this code to backend/config/main.php

    'modules' => [
    'admin' => [
        'controllerMap' => [
            'cms' => 'yii2mod\cms\controllers\CmsController',
       ],
    ],
    ],
  5. Add this code to common/config/main.php

    'components' => [
     'urlManager' => [
         'rules' => [
             ['class' => 'yii2mod\cms\components\PageUrlRule'],
         ]
     ],
    ],
  6. Add this code to SiteController.php in folder frontend/controllers

    public function actions()
    {
    return [
        'page' => [
            'class' => 'yii2mod\cms\actions\PageAction',
        ]
    ];
    }

And now you can create your own pages via admin panel.