Thursday, April 21, 2011

Form Validation Errors At Top of the Page in Symfony

    <?php foreach($form->getWidgetSchema()->getPositions() as $widgetName): ?> <?php if($form[$widgetName]->hasError()): ?>
  • <?php echo $form[$widgetName]->renderLabelName().': '.__($form[$widgetName]->getError()->getMessageFormat()); ?>
  • <?php endif; ?> <?php endforeach; ?>

No comments:

Post a Comment