gpt4 book ai didi

windows - Symfony2 intl 仅支持 "en"

转载 作者:可可西里 更新时间:2023-11-01 10:47:25 26 4
gpt4 key购买 nike

我在安装了 Wamp 和 PHP 5.4.3 的 Windows 机器上工作目前,我正在使用 Symfony2 开发 Web 应用程序。在使用 FormType 创建表单时,我需要插入一个采用 float 而不是字符串的输入字段。所以,我使用了这段代码:

->add ( 'weight', 'number', array (
'label' => 'register.weight',
'widget_addon' => array (
'text' => 'kg',
'type' => 'append'
)
) )

当我点击提交按钮时,出现这个异常:

The Symfony\Component\Intl\NumberFormatter\NumberFormatter::getSymbol() is not implemented. Please install the "intl" extension for full localization capabilities.

所以我通过删除相应的“;”来激活 php_intl 扩展在我的 php.ini 中

之前的异常消失,一切顺利。

但是,当我将 parameters.yml 文件中的“locale”参数从“en”更改为“fr”时,出现以下异常:

Only the locale "en" is supported. 500 Internal Server Error - InvalidArgumentException

我已经被这个异常卡住了 2 天了。我需要一些帮助。

最佳答案

不仅需要 PHP Extension intl,还需要 Symfony 组件: http://symfony.com/doc/current/components/intl.html

将其添加到 composer 中,其他语言环境也应该得到支持。

关于windows - Symfony2 intl 仅支持 "en",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17626161/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com