Re: quick_form but with more control over table structure?
| From: | Justin Patrin | Date: | Sat, 22 Jan 2005 19:01:36 +0000 |
| Subject: | Re: quick_form but with more control over table structure? | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-17107@lists.php.net to get a copy of this message | ||
On Sat, 22 Jan 2005 09:33:26 -0700, Ray Still <rstill74@hotmail.com> wrote:
>
>
> > Hi,
> >
> > Ray Still wrote:
> >> Thanks to help received from the list, I've found out what templates are.
> >> I think that what I want to do is just turn off templates in the
> >> renderer.
> >> The code I've found in the manuals says that I have to:
> >>
> >> require_once "HTML/QuickForm/Renderer/Default.php";
> >>
> >> and then, later on:
> >>
> >> HTML_QuickForm_Renderer_Default::clearAllTemplates();
> >
> >
> > The docs [1] say:
> > "Note: This function can not be called statically."
> >
> > You should create an instance of the renderer and then work with that.
> >
> >> (return value is void, as is the parameter list, by definition)
> >> this gives the following error:
> >> PHP Fatal error: Using $this when not in object context in
> >> C:\php\PEAR\PEAR\HTML\QuickForm\Renderer\Default.php on line 465
> >
> > [1]
> >
> > http://pear.php.net/manual/en/package.html.html-quickform.html-quickform-renderer-default.clearalltemplates.php
> >
> > --
> > PEAR General Mailing List (http://pear.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> Hello,
> Yes; I've read that page
>
> (http://pear.php.net/manual/en/package.html.html-quickform.html-quickform-renderer-default.clearalltemplates.php)
> many times, but I'm not sure how to do it right. I'm new to this, and I
> haven't got used to how it all works. As well, most of the tutorials I can
> find on the web appear to be prior to version 3.2, when apperently this
> feature changed.
> Any help appreciated
> Ray
> can somebody point me in the right dirrection.
>
require_once "HTML/QuickForm/Renderer/Default.php";
$renderer = new HTML_QuickForm_Renderer_Default();
$renderer->clearAllTemplates();
$form->accept($renderer);
echo $renderer->toHTML();
But this isn't going to be what you want. Try using the Array or
ArraySmarty renderer and Smarty. The above is not a template, it's a
renderer which uses element templates. The template systems we mean
are Flexy and Smarty.
--
Justin Patrin