/** * Sets the form to the view * @param zibo\library\html\form\Form $form Form of the data * @return null */ protected function setForm(Form $form) { $fields = array(); $hiddenFields = array(); $fieldIterator = $form->getFields()->getIterator(); foreach ($fieldIterator as $fieldName => $field) { if ($field instanceof SubmitField) { continue; } if (!$field instanceof HiddenField) { $fields[$fieldName] = $fieldName; continue; } if ($fieldName == Form::SUBMIT_NAME . $form->getName()) { continue; } $hiddenFields[$fieldName] = $fieldName; } if ($form instanceof ScaffoldForm) { $fieldLabels = $form->getFieldLabels(); } else { $fieldLabels = array(); } $this->set('form', $form); $this->set('fields', $fields); $this->set('hiddenFields', $hiddenFields); $this->set('fieldLabels', $fieldLabels); }