Re: Quickform renderers
| From: | Erik | Date: | Wed, 01 Oct 2003 14:55:12 +0000 |
| Subject: | Re: Quickform renderers | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8181@lists.php.net to get a copy of this message | ||
Bertrand Mansion wrote:
<erik@vanhoudt.nl> wrote :Yes I mean $Content['Form'] with quotes! The "extract($Content)" command coverts $Content['Form'] to $Form, so if the template is parsed the <?=$Form;?> is replaced with the content of the $Content['Form']. ErikHi, I'm trying to use quickform in my applications, but i'sm runing into problemes. I'm using a sort of templating with php vars and ---------------------------------------------------------------- Templating code ----------------------------------------------------------------Do you mean $Content['Form'] with quotes ? Bertrand Mansion Mamasaminclude $FormPath; extract($Content); ob_start(); include $Path.$TemplateFile; $parsedTemplate = ob_get_contents(); ob_end_clean();---------------------------------------------------------------- Template: ---------------------------------------------------------------- <html> <head> <title>Form</title> </head> <body> <?=$Form;?> </body> </html> ---------------------------------------------------------------- When I use the quickform with the default renderer as in the docs: ---------------------------------------------------------------- File stored in $FormPath: ---------------------------------------------------------------- require_once 'HTML/QuickForm/Renderer/Default.php'; $renderer =& new HTML_QuickForm_Renderer_Default(); $form->accept($renderer); $Content[Form] = $renderer->toHtml(); ---------------------------------------------------------------- The form is not displayed on the right place in the html template where the form is specified. The correct ussage would be that de QuickForm rendered html is stored in the $Content[Form] array an by parsing the template the <?=$Form;?> var in the template is replaced by the rendered QuickForm HTML, but now the QuickForm html is displayed as soon as the file is inlcuded. So not stired in the $Content[Form] . Can anybody help me with this problem?