/** * Invoked at the end of a visit * * @param \r8\Form $form The form being visited * @return Mixed Returns whatever value should be the result of the visit */ public function end(\r8\Form $form) { $formTpl = clone $this->formTpl; $formTpl->set("form", $form->__toString()); $formTpl->set("hidden", $form->getHiddenHTML()); $formTpl->set("fields", $this->fields); $formTpl->set("isValid", $form->isValid()); $formTpl->set("isFormValid", $form->isFormValid()); $formTpl->set("showErrors", $this->showErrors); $formTpl->set("errors", $this->getErrorTpl($form->validateForm())); return $formTpl; }