PHP code example of levoolabs / settings

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

    

levoolabs / settings example snippets


$setting = Setting::get('name');

$setting = setting('name');

Setting::set('name', $value);

setting('name', $value);

if (Setting::exists('name')) {
    //
}

if (setting_exists('name')) {
    //
}

setting_bool('vouchers_enabled', true);
setting_int('max_voucher_per_order', 2)
setting_collection('available_countries', $country_array)
setting_json('meta_description', ['en' => '...', 'hu' => '...'])
setting_secret('my_secret', $secret)

Setting::bool('vouchers_enabled', true);
Setting::int('max_voucher_per_order', 2)
Setting::collection('available_countries', $country_array)
Setting::json('meta_description', ['en' => '...', 'hu' => '...'])
Setting::secret('my_secret', $secret)