Re: Quickform renderers

From: Date: Wed, 01 Oct 2003 13:28:22 +0000
Subject: Re: Quickform renderers
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8178@lists.php.net to get a copy of this message
<erik@vanhoudt.nl> wrote : > Hi, > > 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 > ---------------------------------------------------------------- > include $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? Do you mean $Content['Form'] with quotes ? Bertrand Mansion Mamasam

« previous php.pear.general (#8178) next »