In addition to accessing the static registry via static methods, you can create an instance directly and use it as an object.
The registry instance you access through the static methods is simply one such instance. It is for convenience that it is stored statically, so that it is accessible from anywhere in an application.
Use the traditional new operator to instantiate
Zend_Registry. Instantiating Zend_Registry
using its constructor also makes initializing the entries in the registry simple by
taking an associative array as an argument.
Example 669. Example of Constructing a Registry
<?php
$registry = new Zend_Registry(array('index' => $value));
Once such a Zend_Registry object is instantiated,
you can use it by calling any array object method or by setting it
as the singleton instance for Zend_Registry with the static
method setInstance().
Example 670. Example of Initializing the Singleton Registry
<?php
$registry = new Zend_Registry(array('index' => $value));
Zend_Registry::setInstance($registry);
The setInstance() method throws a
Zend_Exception if the static registry has already been
initialized.




