1. Go to this page and download the library: Download leewillis77/setting-store 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/ */
leewillis77 / setting-store example snippets
// Set a value for the key 'foo'
SettingStore::set('foo', 'bar');
// Set a value for the key 'foo'. The value will be serialized before storing.
SettingStore::setSerialized('foo', ['bar']);
// Retrieve a value for the key 'foo'
$value = SettingStore::get('foo');
// Retrieve a value for the key 'foo', or value 'foobar' if not found
$value = SettingStore::get('foo', 'foobar');
// Retrieve a value for the key 'foo'. The value will be unserialized before being returned.
SettingStore::getSerialized('foo');
// Retrieve a value for the key 'foo'
SettingStore::getSerialized('foo', ['bar']);
$value = SettingStore::get('foo');
use Leewillis77\SettingStore\Repositories\SettingStoreRepository;
public function myControllerAction(SettingStoreRepository $settingStore)
{
$value = $settingStore->get('foo');
}