PHP code example of shoxabbos / yii2-localpages

1. Go to this page and download the library: Download shoxabbos/yii2-localpages 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/ */

    

shoxabbos / yii2-localpages example snippets


php yii migrate --migrationPath=@vendor/shoxabbos/yii2-localpages/migrations

'modules' => [
    'pages' => [
        'class' => '\shoxabbos\localpages\Module',
        'langs' => [
            'ru' => 'Russian',
            'en' => 'English',
        ],
        'defaultRoute' => 'page',
        'defaultLang' => 'ru',
        'layoutPath' => '@app/path/to/layouts',
        'layout' => 'admin',
        'pagesTableName' => 'pages',
        'pagesContentTableName' => 'page_contents',
    ],
]

public function actions()
{
    return [
        'page' => [
            'class' => 'shoxabbos\localpages\actions\ViewAction',
            'viewFile' => 'page'
        ],
    ];
}

'page/<slug:\w+>' => 'site/page'

php composer.phar