Zend Registry check if key exists

16.Feb.2013

To check if Zend_Registry key exists, you should simply use following snippet:

1
2
3
4
5
if(Zend_Registry::isRegistered('my_key')) {
    echo 'Zend Registry key exists, and value is: ' . Zend_Registry::get('my_key');
} else {
    echo 'Zend Registry key does not exist.';
}