public function formHasErrors(FormView $form)
    {
        if ($form->vars['errors']->count()) {
            return true;
        }

        foreach ($form->children as $child) {
            if ($this->formHasErrors($child)) {
                return true;
            }
        }

        return false;
    }