Skip to content

jcherniak/yii2-cms

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMS Extension

  • Scrutinizer Code Quality
  • Build Status

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yii2mod/yii2-cms "*"

or add

"yii2mod/yii2-cms": "*"

to the require section of your composer.json.

Usage

If you use this extension separate from the base template, then you need execute cms init migration by the following command:

php yii migrate/up --migrationPath=@yii2mod/cms/migrations

To use this extension, you have to configure the main config in your application:

'modules' => [
        'admin' => [
            'controllerMap' => [
                'cms' => 'yii2mod\cms\controllers\CmsController'
            ],
        ],
    ],
 'components' => [
        'urlManager' => [
            'rules' => [
                ['class' => 'yii2mod\cms\components\PageUrlRule'],
            ]
        ],
    ],

Add to SiteController (or configure via $route param in urlManager):

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

About

Simple CMS extension

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%