Re: L10N of FormBuilder

From: Date: Tue, 06 Jun 2006 15:10:07 +0000
Subject: Re: L10N of FormBuilder
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-24265@lists.php.net to get a copy of this message
On 6/6/06, Michel D'HOOGE <m.dhooge@enertecgroup.com> wrote:
Hello I tried to localise my FormBuilders and encountered problems with the "denotes required field" footnote. Indeed, it is not available through the FB options (I had a private discussion with Patrin Justin about that and I agree with him that it isn't good to duplicate all options in FB). So I tried and succeeded in overloading the FB class to catch the Form creation and update the footnote's text. Unfortunately, an FB instance can create sub-FB for linked and crossed fields. And in that case, the created sub-FB instance is a plain vanilla one :-( I guess this has to do with PHP's 'emulated OOP' because the call is: $subFB =& DB_DataObject_FormBuilder::create($do); Maybe this could be replaced in all places by something like: $subFB =& $this->create($do); However, my feeling is that it is QuickForm that should implements I18N. But I can't find anything related to this. Any comment?
For any function which is not static using $this-> instead of DB_DataObject_FormBuilder:: make sense to me as it would allow instances of an extended class to be used, but this would be a double-edged sword. create() is meant to be used statically and using it as an instance method could cause problems (say with E_STRICT or PHP6). However, we don't have to do that. ;-) I remembered that create has a parameter for the class of the FB. I've just checked some code into CVS to pass in the correct class for create calls. Does this solve your problem? -- Justin Patrin

« previous php.pear.general (#24265) next »