Just a question.... if I overwrite the formatRow method how do I return the newly formatted row to wherever....
eg public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null) { /*Do stuff to make $field from <input maxlength="50" type="text" name="test[first_name]" id="test_first_name" /> into <span><input maxlength="50" type="text" name="test[first_name]" id="test_first_name" />*/ //Now what? } On Tue, Feb 23, 2010 at 9:43 AM, Sid Bachtiar <sid.bacht...@gmail.com> wrote: > Actually I got very curious and did an experiment myself.Parameter > $field turns out to be a string like: > > '<input maxlength="50" type="text" name="test[first_name]" > id="test_first_name" />' > > So I guess the solution would be a little bit hacky, involving some > regex to detect which field it is and give it a different format > (e.g.: add <span> prefix on one field and append </span> on the second > field) :-\ > > On Tue, Feb 23, 2010 at 8:23 PM, Sid Bachtiar <sid.bacht...@gmail.com> wrote: >> If you look in sfWidgetFormSchemaFormatter class, you could probably >> override method: >> >> public function formatRow($label, $field, $errors = array(), $help = >> '', $hiddenFields = null) >> >> detect the special field through the $field parameter and give it a >> different formatting. >> >> On Tue, Feb 23, 2010 at 8:21 PM, Sid Bachtiar <sid.bacht...@gmail.com> wrote: >>> Oh I just understood why you can't do it LOL sorry >>> >>> On Tue, Feb 23, 2010 at 8:20 PM, Sid Bachtiar <sid.bacht...@gmail.com> >>> wrote: >>>> Why can't you do something like this in template: >>>> >>>> <?php echo $form['not_special_1']->renderRow(); ?> >>>> >>>> <label>We are special:</label> >>>> <span> >>>> <?php echo $form['special_a']->render(); ?> >>>> <?php echo $form['special_b']->render(); ?> >>>> </span> >>>> >>>> <?php echo $form['not_special_2']->renderRow(); ?> >>>> >>>> On Tue, Feb 23, 2010 at 8:09 PM, Gareth McCumskey <gmccums...@gmail.com> >>>> wrote: >>>>> All I really want to do is add a span around two widgets >>>>> (<span><widget1 /><widget2 /></span>). I cannot do this in the >>>>> template because the template is designed to display many different >>>>> form types so the form class needs to define the exact structure of >>>>> the form. >>>>> >>>>> On Tue, Feb 23, 2010 at 9:07 AM, Sid Bachtiar <sid.bacht...@gmail.com> >>>>> wrote: >>>>>> Don't know about the documentation. I had to look around myself to >>>>>> learn about it. >>>>>> >>>>>> Take a look at this example from my blog: >>>>>> http://bluehorn.co.nz/2009/08/31/symfony-12-sfform-formatter-to-add-stars-on-required-fields/ >>>>>> >>>>>> On Tue, Feb 23, 2010 at 7:57 PM, Gareth McCumskey <gmccums...@gmail.com> >>>>>> wrote: >>>>>>> Hi guys, >>>>>>> >>>>>>> I have looked around for the documentation related to creating your >>>>>>> own form decorators but the reference to it in the forms book for >>>>>>> symfony 1.2 says look in Chapter 5 but there is no chapter 5 o.O >>>>>>> >>>>>>> Any pointers to where I could find the info would be appreciated. >>>>>>> >>>>>>> -- >>>>>>> Gareth McCumskey >>>>>>> http://garethmccumskey.blogspot.com >>>>>>> twitter: @garethmcc >>>>>>> >>>>>>> -- >>>>>>> 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. >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Blue Horn Ltd - System Development >>>>>> http://bluehorn.co.nz >>>>>> >>>>>> -- >>>>>> 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. >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Gareth McCumskey >>>>> http://garethmccumskey.blogspot.com >>>>> twitter: @garethmcc >>>>> >>>>> -- >>>>> 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. >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> Blue Horn Ltd - System Development >>>> http://bluehorn.co.nz >>>> >>> >>> >>> >>> -- >>> Blue Horn Ltd - System Development >>> http://bluehorn.co.nz >>> >> >> >> >> -- >> Blue Horn Ltd - System Development >> http://bluehorn.co.nz >> > > > > -- > Blue Horn Ltd - System Development > http://bluehorn.co.nz > > -- > 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. > > -- Gareth McCumskey http://garethmccumskey.blogspot.com twitter: @garethmcc -- 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.