Simplify and clarify Forms and FormViews #54
@ -19,7 +19,7 @@ class FormView extends SubTemplate
|
|||||||
$this->title = $title;
|
$this->title = $title;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function html_content($exclude = [], $include = [])
|
protected function html_content()
|
||||||
{
|
{
|
||||||
if (!empty($this->title))
|
if (!empty($this->title))
|
||||||
echo '
|
echo '
|
||||||
@ -39,14 +39,6 @@ class FormView extends SubTemplate
|
|||||||
|
|
||||||
foreach ($this->form->getFields() as $field_id => $field)
|
foreach ($this->form->getFields() as $field_id => $field)
|
||||||
{
|
{
|
||||||
// Either we have a blacklist
|
|
||||||
if (!empty($exclude) && in_array($field_id, $exclude))
|
|
||||||
continue;
|
|
||||||
// ... or a whitelist
|
|
||||||
elseif (!empty($include) && !in_array($field_id, $include))
|
|
||||||
continue;
|
|
||||||
// ... or neither (ha)
|
|
||||||
|
|
||||||
$this->renderField($field_id, $field);
|
$this->renderField($field_id, $field);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user