From: Christian Weiske on 15 May 2010 13:02 Hi Alexey, > 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']; > > ? Benefit for me is that I do not have to call toArray() :) No, the main reason against the array renderer was that the generated array does not allow access to the elements by their ID. It only has a number-based index that does not help anyone. $ar = $form->render(new HTML_QuickForm2_Renderer_Array())->toArray(); $ar['elements'][0]['id'] $ar['elements'][1]['id'] .... That's what bit me here. Since I needed to hack my own renderer because of that problem, I wanted to do it right - without creating an array that contains information which is not used in 50% of my cases. -- Regards/Mit freundlichen GrüÃen Christian Weiske -=â¡ Geeking around in the name of science since 1982 â¡=-
First
|
Prev
|
Pages: 1 2 Prev: HTML_QuickForm2_Node: ID generation Next: HTML_QuickForm2_Renderer_Array: labelhtml |