PhpRiot
Follow phpriot on Twitter
Sponsored Link
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
Free iPad/iPhone App
Available on the App Store

  • PHP manual
  • Zend Framework manual
  • Smarty manual
  • PHP articles
  • PHP training

Getting Values from the Registry

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

Example 667. 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 668. 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