1

I've been reading some of the questions and answers regarding locales and some of the suggest the use of the Zend Locale library.

Would it be possible to use this library in CodeIgniter or does it depend on other components? I'd like to be able to convert values, currencies and dates if possible without letting go of CI language files.

What do you think? Would it be looking for trouble and hacks to get it working?

RS7
  • 2,341
  • 8
  • 34
  • 57

1 Answers1

2

Zend Framework components are supposed to be usable separately, but some of them depend on other ZF components as well. So, maybe you'll need to provide some others together with Zend_Locale.

You can have a look at the files in Zend/Locale and Zend/Locale.php and grep for require_once statements. After a quick look at Zend/Locale.php it seems that you'll probably need Zend_Registry and Zend_Cache at least.

To make Zend's components work and "auto-require" the files they need, you just have to make sure their root folder 'Zend' is in you include path.

Hope that helps...

Frederik Eychenié
  • 1,253
  • 7
  • 8
dinopmi
  • 2,683
  • 19
  • 24
  • Caching is very recommended for Zend_Locale, but fortunately you just have to configure a Zend_Cache instance an register it in Zend_Registry, Zend_Locale will handle writing an reading from it on it's own. Don't be afraid of adding these two components, Zend_Cache is very simple to configure, and Zend_Registry is just a simple class wrapping an array. – Frederik Eychenié Sep 24 '11 at 12:57