PHP> Zend Framework> Zend_Money

I used Zend_Money to format the currency as follows

$currency = new Zend_Currency(array('value' => $money,
                                    'currency' => 'CAN', 
                                    'format' => 'fr'));

// output -> 100,00 $

Which display is usually displayed on my local development system (wamp on windows)

But when I put it online on my testing server (apache on windows (not my choice, and I can’t change it :(), the code output becomes

// output -> 100,00 €

I would like to know if anyone has ever encountered such a problem and where I need to look for a solution

thank

+3
source share
2 answers

Thank you for moving in the same direction as the solution I choose. I put the new key in my configuration file

variable.locale = "fr_CA"

which is then initiated in bootstrap as a global locale for the entire application

protected function _initLocale(){
    $variables = Zend_Registry::get('config')->variable;
    $locale = new Zend_Locale($variables->locale);
    Zend_Registry::set('Zend_Locale', $locale);
}

,

+2

Zend_Currency . 'locale' => 'fr', , :

locale: . , . , , , , .

+4

Source: https://habr.com/ru/post/1756222/


All Articles