Re: [SMARTY] QuickForm_Controller with SMARTY

From: Date: Fri, 01 Jul 2005 16:34:46 +0000
Subject: Re: [SMARTY] QuickForm_Controller with SMARTY
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12759@lists.php.net to get a copy of this message
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/

« previous php.smarty.general (#12759) next »