symfony 1.4.8. On this message i post how i solved my problem.

Hi, i solved my problem puting this code in my model:

public function setMyField ($value)
{
 $this->_set("my_field", implode("|", $value));
}

public function getMyField ()
{
 $tmp = explode("|",$this->_get("my_field"));
 $values = array();
 foreach ($tmp as $t)  { $values[$t] = $t }
 return $values;
}

On Wed, Jan 5, 2011 at 5:16 PM, Gareth McCumskey <gmccums...@gmail.com>wrote:

> What version of symfony are you using? sfWidgetFormChoice only exists for
> symfony 1.4.
>
>
> On Wed, Dec 29, 2010 at 6:58 PM, emanu.ti <emanu...@gmail.com> wrote:
>
>> Hi, I want to use sfWidgetFormChoice with "multiple" => true
>> parameter. Here is my code:
>>
>> 'leavewhenempty'              => new sfWidgetFormChoice(
>>                 array('multiple' => true, 'expanded' => true,
>> 'choices' => Doctrine_Core::getTable('FilaDeAtendimento')-
>> >getOptionsLeaveWhenEmpty())
>>                                      ),
>>
>> 'leavewhenempty'              => new sfValidatorChoice(
>>                 array('multiple' => true, 'choices' => array_keys(
>>
>> Doctrine_Core::getTable('FilaDeAtendimento')-
>> >getOptionsLeaveWhenEmpty()
>>                                                                     ),
>> 'required' => false)
>>                                       ),
>>
>> but, when I save this form,on my database, is saved the string
>> "Array". I need save the values of checkbox checked, and, when I want
>> edit this register, the checkbox comes checked with the values stored
>> on my database. How solve this?
>>
>> thank's all.
>>
>> --
>> 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<symfony-users%2bunsubscr...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/group/symfony-users?hl=en
>>
>
>
>
> --
> Gareth McCumskey
> http://garethmccumskey.blogspot.com
> twitter: @garethmcc
>
>  --
> 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<symfony-users%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Emmanuel - 8402 - 3552

-- 
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