You may also find it convenient to access the registry
in an object-oriented fashion by using index names as object
properties.
You must specifically construct the registry
object using the ArrayObject::ARRAY_AS_PROPS option
and initialize the static instance to enable this functionality.
Note
You must set the ArrayObject::ARRAY_AS_PROPS option
before the static registry has been accessed for
the first time.
Known Issues with the ArrayObject::ARRAY_AS_PROPS Option
Some versions of PHP have proven very buggy when using the
registry with the ArrayObject::ARRAY_AS_PROPS option.
Example 672. Example of Object Access
<?php
// in your application bootstrap:
$registry = new Zend_Registry(array(), ArrayObject::ARRAY_AS_PROPS)
Zend_Registry::setInstance($registry);
$registry->tree = 'apple';
.
.
.
// in a different function, elsewhere in your application:
$registry = Zend_Registry::getInstance();
echo $registry->tree; // echo's "apple"
$registry->index = $value;
var_dump($registry->index);




