Re: Problem with templates with formsgeneration from phpclasses

From: Date: Tue, 23 Dec 2003 17:21:41 +0000
Subject: Re: Problem with templates with formsgeneration from phpclasses
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10749@lists.php.net to get a copy of this message
Hello, On 12/23/2003 11:32 AM, Dr. Zoidberg wrote:
I have download and install formsgeneration class from phpclasses.org. I'm having some trouble with seting it up to work with my own teplates. If I put: {include file="header.tpl"} it is just ignored? Any body know how can I fix this.
You should process your form templates separately from your page templates. This is because the form class plugins for Smarty do not work well with other page plugins. The form class only generates the form output after the whole form is composed. This is due to the eventual forward dependencies between form fields, labels, etc.. that need to be resolved before generating any form output. This is necessary to support some of the advanced features that this class provides. Probably the best way to solve your problem is to create one Smarty class object for processing your forms. This object should have registered the form class plugins for Smarty. Then create a distinct object to process your page templates. This way the form class plugins won't be mixed with other plugins. If you need to insert the form output in the middle of another template, just pass as parameter the output generated by the form class using the first Smarty object. Later I will probably change the example script of the forms class using Smarty to demonstrate what I am telling you. -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/

« previous php.smarty.general (#10749) next »