There is just no way.

First of all, your form is wrong. Validator and Widgets must have the same
name.

To achieve what you want to do, you could do something like this :

$choices = array
(
  'option1' => '%%option1%%',
  'option2' => '%%option2%%'
);


In your template :

str_replace(array
(
  '%%option1%%',
  '%%option2%%',
),
array
(
  get_partial('...1'),
  get_partial('...2'),
),
$form['']->render());


Enjoy,

Alex'

2009/12/17 Pierre-Gildas MILLON <pg.mil...@gmail.com>

> Hello people,
>
> I'm looking for some ideas in front of a quite simple problem. Here is a
> simple form:
>
> class MyForm extends sfForm
> {
>  public function setup()
>  {
>   $choices = array('option_1', 'option_2');
>   $this->setWidgets(array(
>     'options'     => new sfWidgetFormChoice(array('expanded' => true,
> 'multiple' => true, 'choices' => $choices)),
>   ));
>
>   $this->setValidators(array(
>     'EventId'     => new sfValidatorChoice('choices' => $choices,
> 'multiple' => true),
>   ));
>
>   $this->widgetSchema->setNameFormat('options[%s]');
>
>  }
>
> }
>
> Now, in some view, I'd like to use this form. The goal is to show one of
> the choice somewhere, display some business logic stuff and later show
> the second choice, followed by the submit button. If I use the
> checkbox_tag helper, I will loose the interest of the centralized
> configuration of the form. I can't use a formatter as there is too much
> stuff in the middle of the form.
>
> Does anyone have an idea of how to show only one of the choices of the
> widget anywhere in a view like I tried to explained ?
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to symfony-us...@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.
>
>
>


-- 
Alexandre Salomé
http://alexandre-salome.fr

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@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