PHP code example of zlakomanoff / yii2-lazy-params

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

    

zlakomanoff / yii2-lazy-params example snippets


'lp' => 'zlakomanoff\lazyparams\Component'

<?= Yii::$app->lp->get('option', 'default value') 

'lp' => [
    'class' => 'zlakomanoff\lazyparams\Component',
    'tableName' => 'dynamic_options',
    'keyColumn' => 'keyword',
    'valueColumn' => 'value',
    'liquidMode' => false,
    'enableCache' => false,
    'cacheDefaultValues' => false,
    'cacheComponent' => 'cache',
    'dbComponent' => 'db'
]

echo Yii::$app->lp['param one'];
echo Yii::$app->lp['param two']['default value'];
echo Yii::$app->lp->paramThree('default value');
echo Yii::$app->lp->get('param four', 'default value');