![Picture of Manuel Lemos Picture of Manuel Lemos](/picture/user/1.jpg)
Manuel Lemos - 2006-07-31 05:47:34 -
In reply to message 1 from Shoeb
I am always open to improvement contributions as long as they benefit many users and do not require adding too much code to the core class. Alternatively, the class can also be extended without affecting the code class by the means of plug-ins.
As for your problem, the AddInputPart class does not generate any form output. It just tells the class where you want to make appear a given input.
What happens is that the class can only generate the whole form output when it is aware of all the fields that will appear in the final form composition.
To compose the form output, you can interleave calls to AddInputPart, AddLabelPart and AddDataPart. Alternatively you can print HTML tags mixed with AddInputPart and AddLabelPart calls, within a section defined by calls to StartLayoutCapture and EndLayoutCapture. This is what most examples use.
The Smarty plug-in is a pre-filter. It replaces {input} and {label} marks by tags that make the template engine call AddInputPart, AddLabelPart and AddDataPart function.
Maybe you can make your template engine work similarly.