Registry Component

version
MIT License

Registry component provides a mechanism for storing data globally in a well managed fashion, helping to prevent global meltdown.

Installation

composer require flextype-components/registry

Usage

use Flextype\Component\Registry\Registry;

Create registry object

$registry = new Registry();

Checks if an object with this name is in the registry.

if ($registry->has('var')) {
    // Do something...
}

Registers a given value under a given name.

$registry->set('var', 'value');

Fetch an item from the registry.

$var = $registry->get('var', 'value');

Get registry array

$data = $registry->dump();

License

See LICENSE


Download

Download on the Github