addElement('header', 'hdrTesting', 'Testing Smarty');
$form->addElement('text', 'txtFirstName', 'First name?');
$form->addElement('text', 'txtLastName', 'Last name?');
$form->addElement('text', 'txtAge', 'Age?');
$form->addElement('text', 'txtTelephone', 'Telephone number?');
$form->addElement('reset', 'btnClear', 'Clear');
$form->addElement('submit', 'btnSubmit', 'Submit');
if ($form->validate()) {
# If the form validates then freeze the data
$form->freeze();
}
// Create the template object
$tpl =& new Smarty;
$tpl->caching = false;
$tpl->clear_all_cache();
$tpl->template_dir = '/var/www/new.gami.com/smarty/templates';
$tpl->compile_dir = '/var/www/new.gami.com/smarty/templates_c';
$tpl->cache_dir = '/var/www/new.gami.com/smarty/cache';
$tpl->config_dir = '/var/www/new.gami.com/smarty/configs';
// Create the renderer object
$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
// build the HTML for the form
$form->accept($renderer);
// assign array with form data
$tpl->assign('form_data', $renderer->toArray());
// parse and display the template
$tpl->display('smarty1.tpl');
?>