-
Notifications
You must be signed in to change notification settings - Fork 0
Registry
A simple PHP storage registry.
This class was originally written independent of CodeIgniter but also works nicely as an autoloaded class.
[strong]Download:[/strong] [url=https://github.com/alwarren/php.registry/zipball/master]https://github.com/alwarren/php.registry/zipball/master[/url]
[h2]Usage[/h2]
Loading the class:
[code] // modify application/config/autoload.php $autoload['libraries'] = array('registry'); [/code]
Using the class:
[code] // store a value $value = 'Hello World!' // mixed, can be anything $this->registry->set('mykey', $value);
// retrieve a value $myvar = $this->registry->get('mykey');
// query the registry if ($this->registry->contains('mykey')) { // do something }
// method chaining $value1 = 'Hello World!' $value2 = "It's a great day." $this->registry ->set('mykey1', $value1) ->set('mykey2', $value2) ; [/code]