Re: Savant + quickform_controller
| From: | Ian P. Christian | Date: | Mon, 15 Nov 2004 11:27:38 +0000 |
| Subject: | Re: Savant + quickform_controller | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15504@lists.php.net to get a copy of this message | ||
On Tuesday 09 November 2004 15:43, Paul M Jones wrote:
> I wish I could give you useful feedback, but I cannot. It looks like
> you have adapted Savant2 nicely, but I don't know enough about
> Quickform_Controller to say how well. Maybe the QFC guys would care to
> comment?
I use Savant2 with HTML_Quickform_Controller perfectly well.
class ActionDisplay extends HTML_QuickForm_Action_Display
{
function _renderForm(&$page, $refId = null)
{
$renderer =& new HTML_QuickForm_Renderer_Savant();
$page->accept($renderer);
$tpl =& new Savant2();
$tpl->addPath('template', MODULE_SIGNUP_ROOT . 'templates/');
$tpl->assignRef('form', $renderer->toArray());
$name = get_class($page);
if (file_exists(MODULE_SIGNUP_ROOT . 'templates/' . $name .
'.tpl.php'))
{
$tpl->display($name . '.tpl.php');
}
else
{
$tpl->display('main.tpl.php');
}
}
}
As you can see, it allows a generic template for all pages, and each page can
have a custom template simply by putting a template file in place. I hope
this helps, and I will extend the documentation on my site to include this.
I didn't look at your example, as I don't have the time ;)
--
Ian P. Christian
http://pookey.co.uk
Attachment: [application/pgp-signature]
Attachment: [application/pgp-signature]