Re: HTML_QuickForm2_Renderer: ArrayAccess
| From: | Alexey Borzov | Date: | Thu, 13 May 2010 06:39:24 +0000 |
| Subject: | Re: HTML_QuickForm2_Renderer: ArrayAccess | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-30531@lists.php.net to get a copy of this message | ||
Hi Christian,
On 04.05.2010 0:38, Christian Weiske wrote:
Using my own renderer, I wanted to implement ArrayAccess to get easy access to elements by IDs (see my last mail, "HTML_QuickForm2_Renderer_Array: Element IDs as array key?") in my templates. Unfortunately, the rendering proxy tunnels every method calls and thus prevents usage of ArrayAccess which gets not tunneled. Does someone know how I could get array access working despite the proxy? I cannot instantiate my renderer without the factory since I want to use renderer plugins.Before we go on implementing proxies and stuff, I'd like to understand what is the benefit of accessing renderer rather than the result renderer returns? e.g. $form->render($renderer); echo $renderer['foo']; vs $result = $form->render($renderer)->toArray(); echo $result['foo']; ?