Re: QuickForm labels (again)

From: Date: Mon, 21 Apr 2003 20:14:16 +0000
Subject: Re: QuickForm labels (again)
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-15282@lists.php.net to get a copy of this message
Greetings! Jon Wood wrote:
Attached is a first attempt at multiple labels, currently only with the Default renderer implemented. setLabel can be passed either a single value, or an array of values.
I don't like the idea that it always makes _label property an array; this is kinda bad for BC...
addLabel can be used to add extra labels to an element.
Looks good, but adds to bloat. :] Seriously, this can easily be done using public setLabel()/getLabel() methods. My point is, this 'description' functionality can be added without touching anything except renderers. So I'd like not to touch anything except them unless you give very good reasons to do so. :]
The default renderer will use the first label as the main label, and display the rest below the element, seperated by commas.
Don't you think that implode()'ing the additional labels somewhat goes against the idea of having several labels? Besides, adding a {labels} placeholder to the default element block and always processing it adds some overhead. I suggest: 1) Do not change the default element template, if someone needs this functionality, he should bother about the template himself. 2) If additional labels are present, then assign them to placeholders {label_2}, ..., {label_N} 3) If additional labels are not present, do nothing 4) A usage example for docs/ is a good idea.

« previous php.pear.dev (#15282) next »