Unable to use Zend\\I18n\\View\\Helper\\CurrencyFo

2019-08-01 07:47发布

问题:

I'm trying to implement the CurrencyFormat Helper, but when I instance and object of CurrencyFormat the application is raising an exeption:

$var new CurrencyFormat();

File:
/site/vendor/zendframework/zend-i18n/Zend/I18n/View/Helper/CurrencyFormat.php                    :63
Message:
Zend\I18n\View\Helper component requires the intl PHP extension

In my controller I'm including the library

use Zend\I18n\View\Helper\CurrencyFormat;

I guess I need to add something in composer.json or config files?

Thanks!

回答1:

The error is pretty clear. The component requires the intl PHP extension. This is something that is (usually) bundled with PHP and needs to be enabled on your server.