Re: Re: [ANNOUNCEMENT] HTML_QuickForm_Renderer_Tableless-0.3.0 (alpha) Released.

From: Date: Tue, 11 Jul 2006 20:48:43 +0000
Subject: Re: Re: [ANNOUNCEMENT] HTML_QuickForm_Renderer_Tableless-0.3.0 (alpha) Released.
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-43381@lists.php.net to get a copy of this message
Hi, Mark Wiesemann wrote:
Alexey Borzov wrote:
PEAR Announce wrote:
$GLOBALS['_HTML_QuickForm_default_renderer'] =& $renderer;
Please do not promote such hacks in package description, show the correct usage of accept() instead.
If you consider this as a hack, why does QF offer this possibility? I really like it this way, because it saves one line of code and it allows to use $form->display() with this renderer.
Er, what possibility? Yes, the default renderer instance is kept in global variable but this variable is not actually documented anywhere and such usage is shown neither in documentation nor in examples. The correct way of using custom renderers which *is* documented is via accept() method. You see, I fear the following: after the noobs try to reproduce your code with other renderers, they'll turn to the lists asking "why doesn't that work, I saw that on PEAR site!?" wasting their and my time.
(I'm willing to change it, but I'd like to know why it's offered if one should not use it.)
The defaultRenderer() method is indeed offered, but not the means to replace this default renderer.

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