For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2004 > QuickForms/ITStatic fatal error: undefined function placeholderexists()









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author QuickForms/ITStatic fatal error: undefined function placeholderexists()
Somazx

2004-06-28, 4:08 pm

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',$e
lement['formInfo']['name']."_{$key}"
,$element['formInfo']['label'],$val,$key
,$element['formInfo']['attributes'])
;
}
$r = $form->addGroup($group, $element['formInfo']['name'],
$element['formInfo']['label'], ' ', false);
}

....
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com