I do this to get form errors to an array, and i18n works :
$fields_errors = array();
$global_errors = array();
foreach ($form as $key => $field)
if ($field->getError())
$fields_errors[$key] = $field->getError()->getMessage();
foreach ($form->getGlobalErrors() as $err)
$global_errors[] = $err->getMessage();
I use Doctrine but I think it works the same with Propel, it's more a
sfForm matter.
On 3 déc, 14:20, "david.stendardi" <[email protected]> wrote:
> Hello all,
>
> I'am working on a nice project using symfony combined to extjs for
> frontend development.
>
> The most part of our actions use a custom view that converts the var
> holder to json.
>
> We are migrating to symfony 1.4 (from 1.0) and we didn't manage to
> find a simple way to export translated errors to a simple array ready
> to be json encoded.
>
> I've already done something like
> :http://snipplr.com/view/20688/get-all-symfony-form-errors/
> but it does not support I18N translations...
>
> Maybe we have to extends the default sfWidgetFormSchemaFormatter ?
>
> Does someone has a great piece of code to share that could solve our
> problem ?
>
> Thanks !
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en.