I read somewhere in the docs that if a Zend_Locale key exists in the Registry and it actually contains a Zend_Locale object, then some components will use it by default. Is that true?


A: Zend Framework 1.7+ allows the usage of an application wide locale. You simply set an instance of Zend_Locale to the registry with the key 'Zend_Locale'. Then this instance will be used within all locale aware classes of Zend Framework. This way you set one locale within your registry and then you can forget about setting it again. It will automatically be used in all other classes. See the below example for the right usage:

Example 29.9. Usage of an application wide locale

// within your bootstrap
$locale = new Zend_Locale('de_AT');
Zend_Registry::set('Zend_Locale', $locale);

// within your model or controller
$date = new Zend_Date();
// print $date->getLocale();
echo $date->getDate();

REF: http://files.zend.com/help/Zend-Framework/zend.locale.html

BACK
   Zend Framework Version: 1.12.3