PHP code example of twosuperior / registry

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

    

twosuperior / registry example snippets


'providers' => [
	Twosuperior\Registry\RegistryServiceProvider::class,
],

'Registry' => Twosuperior\Registry\Facades\Registry::class,

'providers' => array(
	'Twosuperior\Registry\RegistryServiceProvider',
),

'Registry' => 'Twosuperior\Registry\Facades\Registry',

Registry::get('foo'); \\will return null if key does not exists
Registry::get('foo.bar'); \\will return null if key does not exists

Registry::get('foo', 'undefine') \\will return undefine if key does not exists

Registry::set('foo', 'bar');
Registry::set('foo', array('bar' => 'foobar'));

Registry::get('foo'); \\bar
Registry::get('foo.bar'); \\foobar

Registry::forget('foo');
Registry::forget('foo.bar');

Registry::clear();

Registry::flush();

Registry::dump('foo');

Registry::all();

$settings = Input::only('name', 'address', 'email');

Registry::store($settings);