PHP code example of elcweb / keyvaluestore-bundle

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

    

elcweb / keyvaluestore-bundle example snippets

 bash
$ php composer.phar update elcweb/keyvaluestore-bundle
 php

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Elcweb\KeyValueStoreBundle\ElcwebKeyValueStoreBundle(),
    );
}
 php
$ks = $this->get('elcweb.keyvaluestore');
$value = $ks->get('KeyName');
 php
$ks = $this->get('elcweb.keyvaluestore');
$values = $ks->getAll('KeyName');

// If you have a keys called foo.bar and foo.foo this will return an array with key bar and foo
 php
$ks = $this->get('elcweb.keyvaluestore');
$ks->set('key', 'value', 'optional description');