Skip to content

Instantly share code, notes, and snippets.

View konradpodgorski's full-sized avatar

Konrad Podgórski konradpodgorski

View GitHub Profile
<?php
private function getErrorMessages(\Symfony\Component\Form\Form $form) {
$errors = array();
if ($form->hasChildren()) {
foreach ($form->getChildren() as $child) {
if (!$child->isValid()) {
$errors[$child->getName()] = $this->getErrorMessages($child);
}