For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2005 > Re: [PEAR] fieldsToRender add/override options to create method in FormBuilder









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] fieldsToRender add/override options to create method in FormBuilder
Justin Patrin

2005-06-09, 3:57 pm

On 6/9/05, Dan Rossi <pear@electroteque.org> wrote:
> hi there I tried to submit functionality for the formbuilder variables
> in the dataobjects to be set before the options sent to the create
> method. This gives the flexbility of overriding/merging the variables
> in the dataobject on a per page basis. For instance I have a label
> setup in the dataobject however of a different page I would like the
> label to be named different. I have had the same issue for
> fieldsToRender where it looks like i have to send the fieldsToRender
> option for each page rather than setting is as global then the ability
> to override this. Let me know what you think.
>=20


It sounds like you'resaying you submitted a feature request about
this but I don't see anything new about this.

As I've said before, this is one of the problems with FormBuilder
being configured in so many ways. One overrides others and it's hard
sometimes to override things.

Personally I *never* use the options array in the create method or set
options on the FB object directly. If I need to override settings in
the DO I set then in the DO instance.

$do =3D& DB_DataObject::factory('table');
$do->fb_fieldsToRender =3D array('field1', 'field2');
$do->fb_fieldLabels['field1'] =3D 'Special label for field1';
$fb =3D& DB_DataObject_FormBuilder::create($do);

--=20
Justin Patrin
Dan Rossi

2005-06-09, 3:57 pm


On 10/06/2005, at 12:54 AM, Justin Patrin wrote:

>
> It sounds like you'resaying you submitted a feature request about
> this but I don't see anything new about this.
>
> As I've said before, this is one of the problems with FormBuilder
> being configured in so many ways. One overrides others and it's hard
> sometimes to override things.
>
> Personally I *never* use the options array in the create method or set
> options on the FB object directly. If I need to override settings in
> the DO I set then in the DO instance.
>
> $do =& DB_DataObject::factory('table');
> $do->fb_fieldsToRender = array('field1', 'field2');
> $do->fb_fieldLabels['field1'] = 'Special label for field1';
> $fb =& DB_DataObject_FormBuilder::create($do);
>
> --
> Justin Patrin
>



Right ?? I suppose setup all the variables like var $fb_fieldsToRender
etc , and then set it all up like that ? Hmm back to the drawing board,
your examples never had this trick :)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com