Re: FormBuilder: field rendering options

From: Date: Sat, 09 Apr 2005 00:54:19 +0000
Subject: Re: FormBuilder: field rendering options
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-37132@lists.php.net to get a copy of this message
On Apr 8, 2005 5:45 PM, Esad Hajdarevic <esad-public@25novembar.com> wrote: > Hi all, > > What do you think of option that would enable > to specify rendering for a field. > > Something like > > $fb_renderAs=array( > Pwd=>'password' > } I assume you meant 'Pass' => 'password'? > > That would make things like: > > function preGenerateForm() { > $this->fb_preDefElements['Pass'] = > HTML_QuickForm::createElement('password', 'Pass', 'Password'); > } > > obsolete. > It's an interesting idea...you can already do things like this by overriding table() and setting the data type of a field, but of course this doesn't help with password fields as they're the same type as a normal text field. The problem with allowing an option to set types is that the different fields do things differently. Using 'password' here makes sense as it only needs those 3 parameters to cerateElement. However, what if someone puts 'select' in there? FormBuilder obviously won't know what to do with that and you'll get an empty select box. The only real reason I can see for this option is to make a text field a password field. If you can give enough other examples where this would be useful I'll consider implmenting it. -- Justin Patrin

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