Skip to content

Instantly share code, notes, and snippets.

@andreia
Created September 17, 2010 03:17
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 andreia/583604 to your computer and use it in GitHub Desktop.
Save andreia/583604 to your computer and use it in GitHub Desktop.
form iterator - sf 1.4
<div class="ui-corner-all">
<?php foreach($form->getFormFieldSchema() as $formField): ?>
<div class="form_field_<?php echo $formField->getName() ?><?php $formField->hasError() and print ' ui-state-error ui-corner-all' ?>">
<div class="label ui-helper-clearfix">
<?php echo $formField->renderLabel(); ?>
</div>
<?php if($help = $formField->renderHelp()): ?>
<div class="help">
<span class="ui-icon ui-icon-help floatleft"></span>
<?php echo strip_tags($help) ?>
</div>
<?php endif; ?>
<?php echo $formField->render() ?>
<?php if($formField->hasError()): ?>
<div class="errors">
<span class="ui-icon ui-icon-alert floatleft"></span>
<?php echo $formField->renderError() ?>
</div>
<?php endif; ?>
</div>
<?php endforeach ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment