On Thursday 24 April 2008 15:24:11 Jeffrey Sambells wrote:
> Flame war starting :)
>
> Let's just put it this way, the Zend_Registry is simply a proper OO
> design pattern implementation similar to php $GLOBALS. If you don't
> care about design patterns then you'll probably find Zend_Registry
> pointless but if you do care about design patterns then you'll use it.
>
> if (!Zend_Registry::isRegistered('somevar')) {
> //do some processing
> Zend_Registry::set('somevar', $value);
> } else {
> $value = Zend_Registry::get('somevar');
> }
>
> is pretty much the same as
>
> if (!array_key_exists( 'somevar', $GLOBALS )) {
> //do some processing
> $GLOBALS['somevar'] = $value;
> } else {
> $value = $GLOBALS['somevar'];
> }
>
Did you mean
!isset($GLOBALS['name']['key']) ? $GLOBALS['name']['key'] = 'default' : '';
and Why I can't use form $GLOBALS['name']['key'] directly ?
Regards
Sancar