Symfony 1.4 Form Value change after getValues()
Posted
by bertzzie
on Stack Overflow
See other posts from Stack Overflow
or by bertzzie
Published on 2010-06-03T03:18:29Z
Indexed on
2010/06/03
3:24 UTC
Read the original article
Hit count: 160
php
|symfony-1.4
Hi, I've got some problem with symfony form value (i guess it's the clean value, but not so clear yet). Here's the problem :
I got a sfFormDateJQueryUI widget setup like this in my form :
$this->setWidgets(array(
'needDate' => new sfWidgetFormDateJQueryUI(),
));
$this->setValidators(array(
'needDate' => new sfValidatorDate(array(
'required' => true,
'date_format' => '/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/',
'date_output' => 'd/m/Y'
)),
));
Then when i submit, say 26/06/2010, it turns out right in the HTTP Header (viewed via Firebug) and $request (i just print it). But after i get the value via
$formVal = $form->getValues();
the date value in $formVal["needDate"]
become today's date (03/06/2010). I really don't understand, and after checking in the API documentation it says that the getValues will return the 'cleaned' value. Is that because of it ? I don't understand what's 'clean'.
Thanks before..
© Stack Overflow or respective owner