forked from kije/FormiX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestFormView.phtml
30 lines (27 loc) · 1.01 KB
/
TestFormView.phtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php /** @var kije\FormiX\View $this */
?>
<?php if ($this->showForm): ?>
<form action="<?php echo $this->formAction; ?>" method="<?php echo $this->formMethod; ?>" class="gen_form">
<dl>
<?php
foreach ($this->formfields as $field) {
$caption = $field->getCaption();
if (!empty($caption)) {
echo sprintf(
'<dt><label for="%s">%s:</label></dt>' . PHP_EOL . '<dd>%s</dd>' . PHP_EOL,
$field->get('id'),
$field->getCaption(),
$field->toHTML()
);
} else {
echo sprintf(
'<dt> </dt>' . PHP_EOL . '<dd>%s</dd>' . PHP_EOL,
$field->toHTML()
);
}
}
?>
</dl>
<div class="clear"></div>
</form>
<?php endif; ?>