Skip to content

Instantly share code, notes, and snippets.

View skineur's full-sized avatar
🧐
node

Achille Njomo skineur

🧐
node
  • Yaounde, Cameroun
View GitHub Profile
@skineur
skineur / FormErrorsSerializer.php
Last active December 10, 2015 15:01 — forked from Graceas/FormErrorsSerializer.php
Symfony 2 Form Error Serializer. Form with class and Form without class
class FormErrorsSerializer {
public function serializeFormErrors(\Symfony\Component\Form\Form $form, $flat_array = false, $add_form_name = false, $glue_keys = '_')
{
$errors = array();
$errors['global'] = array();
$errors['fields'] = array();
if(!empty($form->getConfig()->getDataClass()))
{