PHP code example of bupy7 / yii2-pages
1. Go to this page and download the library: Download bupy7/yii2-pages library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bupy7 / yii2-pages example snippets
'bootstrap' => ['pages'],
...
'modules' => [
...
'pages' => 'bupy7\pages\Module',
]
'modules' => [
...
'pages' => [
'class' => 'bupy7\pages\Module',
'tableName' => '{{%your_table_name}}',
],
]
./yii migrate/up --migrationPath=@bupy7/pages/migrations
'modules' => [
...
'pages' => [
'class' => 'bupy7\pages\Module',
...
'controllerMap' => [
'manager' => [
'class' => 'bupy7\pages\controllers\ManagerController',
'as access' => [
'class' => AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['admin'],
],
],
],
],
],
],
],
'urlManager' => [
'rules' => [
...
'pages/<page:[\w-]+>' => 'pages/default/index',
],
],
'modules' => [
...
'pages' => [
'class' => 'bupy7\pages\Module',
...
'pathToImages' => '@webroot/images',
'urlToImages' => '@web/images',
'pathToFiles' => '@webroot/files',
'urlToFiles' => '@web/files',
'uploadImage' => true,
'uploadFile' => true,
'addImage' => true,
'addFile' => true,
],
],
'modules' => [
...
'pages' => [
'class' => 'bupy7\pages\Module',
'imperaviLanguage' => 'es',
],
]
php composer.phar