thanks, good idead, it is help :)
2008/8/30 SNake! <[EMAIL PROTECTED]>
>
> correct my privious code:
>
> public static function radioFormatter($widget, $inputs)
> {
> $rows = array();
> foreach ($inputs as $input)
> {
> $rows[] = array('input'=> $input['input'], 'label'=>
> $input['label']); // correct here
> }
>
> return $rows;
> }
> ...
> ..
>
> }
>
>
> On 8月30日, 下午1時41分, "SNake!" <[EMAIL PROTECTED]> wrote:
> > I figure out this today:
> >
> > define a static function on your sfForm or some class:
> >
> > class MyForm extends sfForm{
> > ...
> > public static function radioFormatter($widget, $inputs)
> > {
> > $rows = array();
> > foreach ($inputs as $input)
> > {
> > $rows[] = array('input'=> $input['input'], 'label'=>
> > $input['label']
> > }
> >
> > return $rows;
> > }
> > ...
> > ..
> >
> > }
> >
> > and add formatter option to ur Radio Widget:
> >
> > 'your_choices' => new sfWidgetFormSelectRadio(array('choices' =>
> > self::$choices,'formatter'=> array('MyForm ','radioFormatter')
> >
> > and in your templates:
> >
> > <? $radios = $this->form['your_choices']->render(); ?>
> >
> > input1 : <?=$radios[0]['input']?><br/>
> > label1: <?=$radios[0]['label']?>
> >
> > input2 : <?=$radios[1]['input']?><br/>
> > label2: <?=$radios[1]['label']?>
> >
> > Hope this helps
> >
> > Snake
> >
> > On 8月11日, 下午3時39分, "Dmitry Nesteruk" <[EMAIL PROTECTED]> wrote:
> >
> > > How can I to separate choices in the radio button of form? I need form
> with
> > > next structure:
> >
> > > [radio field] title
> > > some desciption
> > > [radio field2] title
> > > some desciption
> > > [radio field3] title
> > > some desciption
> >
> > > The method $form['methods'] returned all choices, but I need something
> like
> > > echo $form['methods']['radio1']->render(); echo
> > > $form['methods']['radio2']->render() etc.
> > > How I can do it in the symfony 1.1?
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---