Article:
  Getting Started with PHP's HTML_QuickForm
Subject:   Pretty Cool, but...
Date:   2004-08-28 11:24:54
From:   lukasn
What would be the best way of integrating HTML_QuickForm with a template engine like Smarty?
Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Pretty Cool, but...
    2005-01-18 14:46:04  aalex [View]

    You should use phpsavant.com instead. It's much lighter and you can access all your PHP variables and functions in the template !!
  • Pretty Cool, but...
    2004-10-31 15:05:16  superbenk [View]

    It's not too hard. Once you instantiate Smarty before the form, you output the form using Pear's Smarty rendering interface. You simply replace the $form->display(); line with something like the following:

    $renderer =& new HTML_QuickForm_Renderer_ArraySmarty($smarty);
    $form->accept($renderer);
    $smarty->assign('new', $renderer->toArray());
    $smarty->display('formtemplate.tpl');