I am making a form in the backend and it allows multiple extensions.
I'm using sfWidgetFormChoice to allow the user to select multiple
options, but I have to concatenate each selection.
1-form:

 $this->widgetSchema['extension'] = new  sfWidgetFormChoice(array(
            'choices'  =>
Doctrine_Core::getTable('IngeindArchivospermitidos')->getExtension(),
            'expanded' => true,
            'multiple' => true
        ));
    }

    public function doBind(array $values)
    {
        if ( isset( $values[ 'extension' ] ) )
        {
            if(is_array( $values[ 'extension' ] ) && !
empty( $values[ 'extension' ] ) )
            {
                $values[ 'extension' ]   = implode( ',',
$values[ 'extension' ] );
            }

            else
            {
                $values[ 'extension' ]='';
            }
        }

        return parent::doBind($values);
    }

2-MODEL:

abstract class PluginIngeindArchivospermitidosTable extends
Doctrine_Table
{
      static public $extension = array(
              'image/jpeg,image/jpeg'                   => 'JPG',
              'image/png,image/x-png'           => 'PNG',
              'image/gif'                               => 'GIF',
              'application/msword'                      => 'doc',
              'application/vnd.ms-powerpoint'           => 'ppt',
              'application/x-msexcel'                   => 'xls',
              'application/pdf,application/x-pdf'    => 'pdf',
      );


      public function getExtension()
     {
              return self::$extension;
      }
}

but I have a problem when I want to edit, do not load the form data
and do not know how to fix it. anyone knows how to do

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to