PHP code example of fgh151 / yii2-params

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

    

fgh151 / yii2-params example snippets


        'modules' => [
               ...
               'params' => [
                   'class' => 'fgh151\modules\params\Module',
                   'paramsFilePath' => [
                       'Common params' => '@common/config/params.php',
                       'Backend Params' => '@backend/config/params.php',
                       'Frontend Params' => '@frontend/config/params.php',
                   ]
               ]
           ],

        'modules'    => [
             'params' => [
                'class' => 'fgh151\modules\params\Module',
                'paramsFilePath' => [
                    'Common params' => '@common/config/params.php',
                    'Backend Params' => '@backend/config/params.php',
                    'Frontend Params' => '@frontend/config/params.php',
                ],
                'as access' => [
                    'class' => 'yii\filters\AccessControl',
                    'rules' => [
                        [
                            'allow' => true,
                            'roles' => ['admin'],
                        ]
                    ]
                ]
             ]
            ...
        ],

php composer.phar 
index.php?r=params