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.
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',
],
];
}