Posts Tagged sfFormAddonsPlugin

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