Hi,

You can do so by implementing a custom renderer for the choice widget.

Example:

class MyRenderer extends sfWidgetForm
{
  /**
   * Configures the widget.
   *
   * The widget has one single option:
   *
   *   choices:   An sfCallable() that returns the choices
   *
   * @see sfWidgetForm
   */
  protected function configure($options = array(), $attributes = array())
  {
    $this->addRequiredOption('choices');
  }

  /**
   * Renders custom HTML
   *
   * @param  string $name       The name of the choice field
   * @param  string $value      The selected choice
   * @param  array $attributes  Ignored.
   * @param  array $errors      Ignored.
   * @return string
   */
  public function render($name, $value = null, $attributes = array(),
$errors = array())
  {
    $choices = $this->getOption('choices')->call();

    // build and return HTML
  }
}

Then use it like this:

new sfWidgetFormChoice(array('choices' => ..., 'renderer_class' =>
'MyRenderer'));


Cheers,

Bernhard

--
Software Architect & Engineer
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart

2010/10/28 FourFour <[email protected]>:
> Hi All,
>
> First post. This one is killing me. I want to use 5 radio inputs for a
> 5 star rating scale, and use a jQuery Star Rating plugin to convert
> these radio inputs into the stars. To do so, I need to remove both the
> <ul> and <li> tags that wrap the inputs. Can anyone point me in the
> right direction as to how best to remove these tags, so I can use
> $form['rating']->renderRow() to simply output the radio button tags
> with no <ul> and <li>'s?
>
> Really appreciate your help.
>
> Cheers,
>
> Steve
>
> --
> 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 developers" 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-devs?hl=en
>

-- 
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 developers" 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-devs?hl=en

Reply via email to