Symfony2 表单日期时间错误
当我尝试在 symfony2 中创建 CRUD 时遇到问题。我无法显示日期时间选择。我总是遇到这个问题。
可捕获的致命错误:参数 1 传递给 Symfony\Component\Form\Extension\Core\ChoiceList\MonthChoiceList::__construct() 必须是 IntlDateFormatter 的实例,给定 null,在
中调用
任何想法中调用?
表格类型代码:
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('nome')
->add('email')
->add('senha')
->add('is_super')
->add('is_active')
->add('created') ;
}
I have a problem when I try to create a crud in symfony2. I can't show the datetime choice. I always get this problem.
Catchable Fatal Error: Argument 1 passed to
Symfony\Component\Form\Extension\Core\ChoiceList\MonthChoiceList::__construct()
must be an instance of IntlDateFormatter, null given, called in
Any idea?
FormType code:
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('nome')
->add('email')
->add('senha')
->add('is_super')
->add('is_active')
->add('created') ;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题,并通过安装 php_intl 扩展 解决了它。 Ubuntu 中的软件包是 php5-intl。
I had the same problem and solved it by installing the php_intl extension. the package is php5-intl in Ubuntu.
多谢 !您需要 intl :然后停用它(使用 wamp/php 5.3.9)!
有时 intl 扩展名会丢失 dll。您从 apache/bin/ 中的 php 文件夹复制 icu*.ddl。 (可能是因为在 wamp 中 php.ini 位于 apache/bin 中)。
Thanks a lot ! You need intl : then deactivate it (with wamp/php 5.3.9) !
Sometimes intl extension is missing dlls. You copy your icu*.ddl from your php folder in your apache/bin/. (Probably because in wamp php.ini is in apache/bin).