View Single Post
  #2 (permalink)  
Old 08-14-2007, 09:52 AM
borec borec is offline
Member
 
Join Date: Aug 2007
Location: Tarnow/Krakow, Poland, EU
Posts: 30
Default

It sucks, but you can only use 1-dimensional array:

Code:
echo $registry->system['name']; 
echo '<br />'; 
echo $registry->system['time']['zone'];
Update:
You can also do this:

Code:
# Load everything from config.ini.
$config = new Zend_Config_Ini('config.ini', null); 

# Create a new Zend_Registry not from, but with the config. 
$registry = new Zend_Registry(array('config' => $config), ArrayObject::ARRAY_AS_PROPS);

# Unset the static instance. 
Zend_Registry::_unsetInstance(); 

# Set the static instance. 
Zend_Registry::setInstance($registry); 

# Test. 
$registry = Zend_Registry::getInstance(); 
echo $registry->config->system->name;
echo '<br />'; 
echo $registry->config->system->time->zone;
__________________
I don't trust anything that bleeds for five days and doesn't die.
www.inetive.pl

Last edited by borec : 08-14-2007 at 09:55 AM.
Reply With Quote