1.7. Zend::register()

Registers an object in the object store.

<?php
	
register($name, $object)

?>

The registry is a mechanism for providing singleton instances of objects to the application space. By storing the object in the registry once, and then retrieving the object from the registry whenever it is needed, the same instance is always returned.

The $name is an arbitrary string to name the object in the store. This name will be supplied to Zend::registry() to retrieve the object again.

The $name argument must be a string, only objects may be stored in the registry, an object can never be removed from the registry, and an instance can only be stored once in the registry. Failure to obey these rules will result in Zend_Exception being thrown.