2
votes

I'm still developing a symfony2 application, and when I try to submit an embedded form, I get

Fatal error: Call to a member function setAttribute() on a non-object in C:\wamp\www\Symfony\vendor\symfony\src\Symfony\Component\Form\Extension\Core\DataTransformer\NumberToLocalizedStringTransformer.php on line 130

Some basic NumberFormatter code :

$fmt = new NumberFormatter( locale_get_default(), NumberFormatter::DECIMAL );

echo $fmt->format(123.123123);

In fact, I can't even construct a NumberFormatter object despite the fact I've enabled intl. I am currently working on WAMP 2.2c

Conf :

PHP 5.3.9 intl 1.1.0.0

Any idea ? Thanks.

2
I wonder why symfony doesn't signal the flaw earlier. You should show some code. - hakre
Done it, but it really is a NumberFormatter construction problem. - David B.
So the code you've posted gives a fatal error as well? - hakre
Yes, exactly the same. Except for the filename of course.. - David B.
and except for the method, obviously. Another funny thing is that it perfectly runs on my Archlinux. I heard somewhere it's a int.dll problem... But how ? When ? Whaat !? - David B.

2 Answers

2
votes

Have you tried this:

$fmt = new \NumberFormatter( locale_get_default(), \NumberFormatter::DECIMAL );

or add:

use \NumberFormatter as NumberFormatter;
2
votes

Well well well...

After some research, I heard it actually was an ICU dll problem. So I went to their website, download + install. Nothing happened.

So, I just went here : http://windows.php.net/download/ I downloaded the same version I have installed, picked up all the icu*.dll files and put it in wamp/bin/php/php5.3.9/