root/trunk/lib/widget/sfWidgetFormSchemaFormatterDiv.class.php

Revision 75, 0.7 kB (checked in by nperriault, 3 months ago)

[1.1]:

  • Companies and people modules migrated, with according form classes and templates, and functional test suite
  • Enhanced SymfoniansTestBrowser?
Line 
1 <?php
2 /**
3  * Symfonians forms global formatter
4  *
5  */
6 class sfWidgetFormSchemaFormatterDiv extends sfWidgetFormSchemaFormatter
7 {
8   protected
9     $rowFormat       = "<div class=\"form-row%is_error%%is_required%\">\n  %label%\n  %error%\n  %field%\n  %help%\n%hidden_fields%</div>\n",
10     $errorRowFormat  = "%errors%\n",
11     $helpFormat      = '<div class="form-help">%help%</div>',
12     $decoratorFormat = "\n  %content%";
13
14   public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null)
15   {
16     return strtr(parent::formatRow($label, $field, $errors, $help, $hiddenFields), array(
17       '%is_error%'    => (count($errors) > 0) ? ' field_error' : '',
18       //'%is_required%' => $field,
19     ));
20   }
21 }
Note: See TracBrowser for help on using the browser.