Symfony 1.1 Form: Urgently Needed

Eveybody like symfony 1.1 form, but there are several fatures of symfony 1.0 forms which are not yet available under symfony 1.1.
The missing widgets in symfony 1.1 which all peoples should have, are rich textarea, rich input date time, and so on.
Looking up at the form helper code, I decided to make it available for symfony 1.1. The sfFormAddonsPlugin provide some widgets:

  1. sfWidgetFormRichTextarea (currently only support TinyMCE).
    Example usage:

    $this->widgetSchema['content'] = new sfWidgetFormRichTextarea(array(
      'textarea' => array('rows' => 10, 'cols' => 60),
      'editor'   => array(
        'tinymce_options' => array(
          'content_css'             => '/css/tinymce.css',
          'plugins'                 => 'advimage,advlink,flash',
          'theme_advanced_buttons1' => 'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,undo,redo,|,image,|,cleanup,removeformat,hr,|,code',
          'theme_advanced_buttons2' => '',
          'theme_advanced_buttons3' => '',
        )
      )
    ));
  2. sfWidgetFormInputCalendar (input_date_tag() with 'rich' => true option, using Calendar). This widget must be paired with sfValidatorDateAdvanced.
    Example usage:

    $this->widgetSchema['created_at'] = new sfWidgetFormInputCalendar(array('with_time' => true));
    $this->validatorSchema['created_at'] = new sfValidatorDateAdvanced(array('with_time' => true));
  3. sfWidgetFormInputAutocomplete, using JQuery.
    Example usage:

    $this->widgetSchema['category_name'] = new sfWidgetFormInputAutocomplete(array('url' => '@weblog_category_completion'));
  4. sfWidgetFormChecklist. This widget must be paired with sfValidatorChoiceMany.
    Example usage:

    $choices = array(1 => 'One', 2 => 'Two', 3 => 'Three');
    $this->widgetSchema['choices'] = new sfWidgetFormChecklist(array('choices' => $choices));
    $this->validatorSchema['choices'] = new sfValidatorChoiceMany(array('choices' => array_keys($choices)));

Download: sfFormAddonsPlugin.zip

3 Comments

  1. nice plugin, but how do i install it?

  2. sorry man, found the solution. i’ve forgotten to enable the plugin in settings.yml :/

  3. I found a bug in your plugin… the format attribute is not working in sfWidgetFormInputCalendar.

    you should change line 52:

    $pattern = $this->getOption(‘format’) ? $this->getOption(‘format’) : $withTime ? ‘g’ : ‘d’;

    With this one:

    $pattern = ($this->getOption(‘format’)) ? $this->getOption(‘format’) : ($withTime ? ‘g’ : ‘d’);

Leave a Reply to NeuquinoCancel reply