PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Getting Values from the Registry

To retrieve an entry from the registry, use the static get() method.

Example 685. Example of get() Method Usage

<?php
$value 
Zend_Registry::get('index');

The getInstance() method returns the singleton registry object. This registry object is iterable, making all values stored in the registry easily accessible.

Example 686. Example of Iterating over the Registry

<?php
$registry 
Zend_Registry::getInstance();

foreach (
$registry as $index => $value) {
    echo 
"Registry index $index contains:\n";
    
var_dump($value);
}

Zend Framework