QuickForms/ITStatic fatal error: undefined function placeholderexists()
| From: | Somazx | Date: | Mon, 28 Jun 2004 16:34:09 +0000 |
| Subject: | QuickForms/ITStatic fatal error: undefined function placeholderexists() | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-13377@lists.php.net to get a copy of this message | ||
Fatal error: Call to undefined function: placeholderexists() in
/usr/home/attain/pear/lib/HTML/QuickForm/Renderer/ITStatic.php on line 283
I'm working with HTML_QuickForms and using its StaticIT templating support.
My form worked fine up until the point where I include an addGroup call - at
which point the $form->accept($renderer) call returns the above error.
Here is my code:
...
function outputEditForm()
{
require_once ('HTML/QuickForm.php');
require_once ('HTML/Template/IT.php');
require_once ('HTML/QuickForm/Renderer/ITStatic.php');
$form = new HTML_QuickForm('listingForm', 'POST');
$form->addElement('header', null, 'Property Listing Form');
$tpl =& new HTML_Template_IT('.');
$tpl->loadTemplateFile('editListingTemplate.tpl.htm'); // or
whatever you called it
$renderer =& new HTML_QuickForm_Renderer_ITStatic($tpl);
$renderer->setRequiredTemplate('{label}<font color="red"
size="1">*</font>');
$renderer->setErrorTemplate('<font
color="red">{error}</font><br
/>{html}');
foreach($this->structure as $key => $data)
{
$this->{'_addElement_' .
$data['formInfo']['type']}($data,
$form);
}
$form->addElement('submit', null, 'Send');
$form->accept($renderer);
$tpl->show();
}
/*
** Private methods
*/
function _addElement_checkbox(&$element, &$form)
{
foreach($element['formInfo']['valueList'] as $key => $val)
{
$group[] =&
HTML_QuickForm::createElement('checkbox',$element['formInfo']['name']."_{$ke
y}",$element['formInfo']['label'],$val,$key,$element['formInfo']['attributes
']);
}
$form->addGroup($group, $element['formInfo']['name'],
$element['formInfo']['label'], ' ');
}
function _addElement_radio(&$element, &$form)
{
foreach($element['formInfo']['valueList'] as $key => $val)
{
$group[] =&
HTML_QuickForm::createElement('radio',$element['formInfo']['name']."_{$key}"
,$element['formInfo']['label'],$val,$key,$element['formInfo']['attributes'])
;
}
$r = $form->addGroup($group, $element['formInfo']['name'],
$element['formInfo']['label'], ' ', false);
}
...