What I do is set the readonly parameter via the widget constructor

$this->setWidgets(array(
            'price'               => new
sfWidgetFormInputText(array(), array('readonly' => 'readonly')),
     ));

and then use jQuery to convert the input element to a div or span. I
can share the code later if you need it.

On Jun 7, 12:31 pm, Tom Ptacnik <to...@tomor.cz> wrote:
> Look 
> herehttp://groups.google.com/group/symfony-users/browse_thread/thread/80f...
>
> On 4 čvn, 22:00, fRAnKEnSTEin <shirkav...@gmail.com> wrote:
>
> > Hi there,
>
> > Is there any way of rendering a form widget as a label? for example if
> > i have a form called ""fooForm" defined as:
>
> > ...
> > ...
> > public function configure()
> > {
> >      ...
> >      ...
> >      $this->setWidgets(array(
> >             'price'               => new sfWidgetFormInputText(),
> >      ));
> >      ...
> >      ...
>
> > }
>
> > then in my template:
>
> > <div> <?php echo $form['price']->render() ?> </div>
>
> > Instead of rendeing the widget as an input text element, i need to
> > render it like a label element. I have searched is there is any
> > "sfWidgetFormLabel" or something but there is not.
>
> > Any idea?
>
> > Cheers
>
>

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