Re: HTML_Quickform setFormTemplate
| From: | Bertrand Mansion | Date: | Fri, 08 Aug 2003 07:59:01 +0000 |
| Subject: | Re: HTML_Quickform setFormTemplate | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7102@lists.php.net to get a copy of this message | ||
<keith@midnighthax.com> wrote :
> I've just added the following lines to some code:
>
> $template_str = "\n<form{attributes}>\n";
> $template_str .= "\n{content}\n\n</form>";
> $form->setFormTemplate($template_str);
>
> ...and now I get the error "Method HTML_QuickForm::setFormTemplate() is
> now deprecated in file xxx".
>
> What SHOULD I be doing?
QuickForm now uses renderers for form display.
The idea is described in the doc:
http://pear.php.net/manual/en/package.html.html-quickform.intro-renderers.ph
p
Your code becomes:
$renderer =& new HTML_QuickForm_Renderer_Default();
$template_str = "\n<form{attributes}>\n";
$template_str .= "\n{content}\n\n</form>";
$renderer->setFormTemplate($template_str);
It just adds one line for QuickForm renderer instantiation.
Bertrand Mansion
Mamasam