Re: [SMARTY] QuickForm_Controller with SMARTY
Maximillian Schwanekamp <[email protected]>
| Newsgroups | gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <[email protected]> |
Peter Jasovsky wrote:
> Hi there,
> does anybody know how does QuickForm_Controller works with Smarty
> together?
> <!--beginning-->
> <form {$form.attributes}>
> <!--info panel with: Please enter the following-->
> {$form.hidden}
> Step 1<br />
> {$form.header.info}<br /><br />
> {$form.blogmessage.html}<br /><br />
> {$form.firstname.label}{$form.firstname.html}<br />
> {$form.lastname.label}{$form.lastname.html}<br />....
> </form>
Yes I use the Smarty/QF combo a lot these days. If you're not seeing
the anything from QF there, probably you've just forgotten to assign()
the form as an array. Cf this example:
http://www.thelinuxconsultancy.co.uk/smarty-guide.php#doc_chap4
What I do is extend HTML_Quickform with a class that composes an
instance of the Smarty renderer in its constructor, so that my Smarty-QF
php looks like this:
// build the HTML for the form
$form->accept_renderer();
// assign array with form data
$form_data = $form->renderer->toArray();
$tpl->assign('contactform', $form_data);
The main reason I do it this way is so that if I should decide to change
the renderer, I need not do it thoughout all my php pages that make a QF
form, but just in the one class.
HTH
--
Maximillian Von Schwanekamp
http://www.neptunewebworks.com/
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php