PHP code example of thefx / yii2-blocks

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

    

thefx / yii2-blocks example snippets


php yii migrate --migrationPath=@thefx/blocks/migrations

return [
    'modules' => [
        'blocks' => [
            'class' => 'thefx\blocks\Module',
            'layoutPath' => '@app/modules/admin/layouts',
            'layout' => 'page',
            'layoutPure' => 'pure',
            'rootUsers' => [1],
        ...
        ]
        ...
    ],
];

    'as access blocks' => [
        'class' => 'yii\filters\AccessControl',
        'only' => ['pages/*', 'blocks/*'],
        'rules' => [
            [
                'allow' => true,
                'roles' => ['@'],
            ],
        ],
    ],