On Wed, May 14, 2008 at 2:44 PM, thomas.s <[EMAIL PROTECTED]> wrote:

>  This way I can only choose between the default symfony formatter, or
>  am I missing something? What if I want to use my own formatter?

You can write your own formatter, extending
sfWidgetFormSchemaFormatter, with just the end of the class name as an
identifier. Here's a div based example :

class sfWidgetFormSchemaFormatterDiv extends sfWidgetFormSchemaFormatter
{
  protected
    $rowFormat       = "<div class=\"form-row\">\n  %error%%label%\n
%field%%help%\n%hidden_fields%</div>\n",
    $errorRowFormat  = "<div class=\"form-errors\">\n%errors%</div>\n",
    $helpFormat      = '<div class="form-help">%help%</div>',
    $decoratorFormat = "<div>\n  %content%</div>";
}

You can just set it as a default using
sfWidgetFormSchema::setDefaultFormFormatterName('div') in your app or
project configuration class. If you need to set it just for one form,
in the configure() method use
$this->widgetSchema->setFormFormatter('div').

Last but not least, all of these will be thoroughly documented very soon now.

++

--
Nicolas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to