Skip to content

Instantly share code, notes, and snippets.

@weaverryan
Created January 14, 2012 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weaverryan/1612036 to your computer and use it in GitHub Desktop.
Save weaverryan/1612036 to your computer and use it in GitHub Desktop.
Collecting FormView errors into an array
<?php
function aggregateFormErrors(FormView $form, $errors = array())
{
$errors = array_merge($errors, $form->get('errors'));
foreach ($form as $field) {
$errors = self::aggregateFormErrors($field, $errors);
}
return $errors;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment