--TEST--
Template Test: forms.html
--FILE--
'hello',
'test12a' => 'hello',
'test12ab' => 'hello',
'fred' => 'hello',
'aaa1' => 'hello',
'List' => '2000',
'testingxhtml' => 'checked',
));
$elements["testingcheckbox"] = new HTML_Template_Flexy_Element;
$elements["testingcheckbox"]->setValue(123);
#bug6058
$elements['payment_1_type'] = new HTML_Template_Flexy_Element;
$elements['payment_1_type']->attributes['flexy:xhtml'] = true;
$elements['payment_1_type']->setValue('cq');
// this exhibits unusual behavior, but is not really a bug
// actually the correct usage is to use '' where 'input' is.
$elements['payment_2_type'] = new HTML_Template_Flexy_Element('input',
array('flexy:xhtml' => true));
$elements['payment_2_type']->setValue('cq');
compilefile('forms.html',
array(),
array(
'show_elements' => true
),
$elements
);
--EXPECTF--
===Compiling forms.html===
===Compiled file: forms.html===
Form Not Parsed
Parsed
elements['test']->toHtmlnoClose();?>
Inputelements['test123']->toHtml();?>
Checkbox elements['test123a']->toHtml();?>
Hidden elements['test123ab']->toHtml();?>
elements['fred']->toHtml();?>
elements['aaa1']->toHtml();?>
elements['aaa3']->toHtml();?>
elements['opt_1'];
if (isset($this->elements['opt[]'])) {
$_element = $this->mergeElement($_element,$this->elements['opt[]']);
}
echo $_element->toHtml();?>
elements['opt_2'];
if (isset($this->elements['opt[]'])) {
$_element = $this->mergeElement($_element,$this->elements['opt[]']);
}
echo $_element->toHtml();?>
elements['opt_3'];
if (isset($this->elements['opt[]'])) {
$_element = $this->mergeElement($_element,$this->elements['opt[]']);
}
echo $_element->toHtml();?>
elements['List']->toHtml();?>
elements['_submit[4]']->toHtml();?>
elements['_submit[5]']->toHtml();?>
elements['testupload']->toHtml();?>
#bug bug6058
elements['1'];
if (isset($this->elements['payment_1_type'])) {
$_element = $this->mergeElement($_element,$this->elements['payment_1_type']);
}
echo $_element->toHtml();?>
Credit card
elements['2'];
if (isset($this->elements['payment_1_type'])) {
$_element = $this->mergeElement($_element,$this->elements['payment_1_type']);
}
echo $_element->toHtml();?>
Cheque
elements['3'];
if (isset($this->elements['payment_2_type'])) {
$_element = $this->mergeElement($_element,$this->elements['payment_2_type']);
}
echo $_element->toHtml();?>
Credit card
elements['4'];
if (isset($this->elements['payment_2_type'])) {
$_element = $this->mergeElement($_element,$this->elements['payment_2_type']);
}
echo $_element->toHtml();?>
Cheque
elements['picture']->toHtml();?>
Bug 1120:
Bug 1275 XHTML output
elements['testingxhtml']->toHtml();?>
elements['xhtmllisttest']->toHtml();?>
Bug 4005 Checkboxes
elements['testingcheckbox']->toHtml();?>
elements['test_mix']->attributes['action'])) {
$this->elements['test_mix']->attributes['action'] = '';
$this->elements['test_mix']->attributes['action'] .= htmlspecialchars($t->someurl,ENT_COMPAT,'UTF-8');
}
$_attributes_used = array('action');
echo $this->elements['test_mix']->toHtmlnoClose();
if (isset($_attributes_used)) { foreach($_attributes_used as $_a) {
unset($this->elements['test_mix']->attributes[$_a]);
}}
?>
elements['testing5']->attributes['value'])) {
$this->elements['testing5']->attributes['value'] = '';
$this->elements['testing5']->attributes['value'] .= htmlspecialchars($t->somevalue,ENT_COMPAT,'UTF-8');
}
$_attributes_used = array('value');
echo $this->elements['testing5']->toHtml();
if (isset($_attributes_used)) { foreach($_attributes_used as $_a) {
unset($this->elements['testing5']->attributes[$_a]);
}}
?>
elements['_submit[3]']->toHtml();?>
Array
(
[test] => HTML_Template_Flexy_Element Object
(
[tag] => form
[attributes] => Array
(
[name] => test
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[test123] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[name] => test123
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[test123a] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[name] => test123a
[id] => test123ab
[type] => checkbox
[checked] => 1
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[test123ab] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[name] => test123ab
[type] => hidden
[value] => 123
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[fred] => HTML_Template_Flexy_Element Object
(
[tag] => textarea
[attributes] => Array
(
[name] => fred
)
[children] => Array
(
[0] => some text
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[aaa1] => HTML_Template_Flexy_Element Object
(
[tag] => select
[attributes] => Array
(
[name] => aaa1
)
[children] => Array
(
[0] =>
[1] => HTML_Template_Flexy_Element Object
(
[tag] => option
[attributes] => Array
(
)
[children] => Array
(
[0] => aa
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[2] =>
[3] => HTML_Template_Flexy_Element Object
(
[tag] => option
[attributes] => Array
(
[selected] => 1
)
[children] => Array
(
[0] => bb
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[4] =>
[5] => HTML_Template_Flexy_Element Object
(
[tag] => option
[attributes] => Array
(
)
[children] => Array
(
[0] => cc
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[6] =>
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[aaa3] => HTML_Template_Flexy_Element Object
(
[tag] => select
[attributes] => Array
(
[name] => aaa3
)
[children] => Array
(
[0] =>
[1] => HTML_Template_Flexy_Element Object
(
[tag] => option
[attributes] => Array
(
)
[children] => Array
(
[0] => aa
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[2] =>
[3] => HTML_Template_Flexy_Element Object
(
[tag] => option
[attributes] => Array
(
[selected] => 1
)
[children] => Array
(
[0] => bb
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[4] =>
[5] => HTML_Template_Flexy_Element Object
(
[tag] => option
[attributes] => Array
(
)
[children] => Array
(
[0] => cc
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[6] =>
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[opt_1] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[id] => opt_1
[type] => checkbox
[name] => opt[]
[value] => 1
[/] => 1
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[opt_2] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[id] => opt_2
[type] => checkbox
[name] => opt[]
[value] => 2
[/] => 1
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[opt_3] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[id] => opt_3
[type] => checkbox
[name] => opt[]
[value] => 3
[/] => 1
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[List] => HTML_Template_Flexy_Element Object
(
[tag] => select
[attributes] => Array
(
[name] => List
)
[children] => Array
(
[0] =>
[1] => HTML_Template_Flexy_Element Object
(
[tag] => option
[attributes] => Array
(
[value] => 2000
)
[children] => Array
(
[0] => 2000
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[2] =>
[3] => HTML_Template_Flexy_Element Object
(
[tag] => option
[attributes] => Array
(
[value] => 2001
)
[children] => Array
(
[0] => 2001
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[4] =>
[5] => HTML_Template_Flexy_Element Object
(
[tag] => option
[attributes] => Array
(
[value] => 2002
)
[children] => Array
(
[0] => 2002
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[6] =>
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[_submit[4]] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => submit
[name] => _submit[4]
[value] => Next >>
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[_submit[5]] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => submit
[name] => _submit[5]
[value] => Next >>
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[testupload] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => file
[name] => testupload
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[payment_1_type] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => radio
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[1] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => radio
[name] => payment_1_type
[id] => 1
[value] => cc
[/] => 1
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[2] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => radio
[name] => payment_1_type
[id] => 2
[value] => cq
[/] => 1
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[payment_2_type] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => radio
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[3] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => radio
[name] => payment_2_type
[id] => 3
[value] => cc
[/] => 1
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[4] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => radio
[name] => payment_2_type
[id] => 4
[value] => cq
[/] => 1
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[picture] => HTML_Template_Flexy_Element Object
(
[tag] => img
[attributes] => Array
(
[name] => picture
[id] => picture
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[testing] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[name] => testing
[value] => test
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[_submit[2]] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => submit
[value] => x
[name] => _submit[2]
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[testing2] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[name] => testing2
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[_submit[1]] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => submit
[name] => _submit[1]
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[testingxhtml] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => checkbox
[name] => testingxhtml
[checked] => 1
[flexy:xhtml] => 1
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[xhtmllisttest] => HTML_Template_Flexy_Element Object
(
[tag] => select
[attributes] => Array
(
[name] => xhtmllisttest
[flexy:xhtml] => 1
)
[children] => Array
(
[0] =>
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[testingcheckbox] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => checkbox
[name] => testingcheckbox
[value] => 123
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[test_mix] => HTML_Template_Flexy_Element Object
(
[tag] => form
[attributes] => Array
(
[name] => test_mix
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[testing5] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[name] => testing5
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
[_submit[3]] => HTML_Template_Flexy_Element Object
(
[tag] => input
[attributes] => Array
(
[type] => submit
[name] => _submit[3]
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
[label] =>
)
)
===With data file: forms.html===
Form Not Parsed
Parsed
Bug 1120:
Bug 1275 XHTML output
Bug 4005 Checkboxes