/** * Returns a template for displaying errors filled with the proper values * * @param \r8\Validator\Result $result The validation result to render * @return \r8\iface\Template */ private function getErrors(\r8\Validator\Result $result) { if ($result->isValid()) { return ""; } return "<ul class='form-errors'>" . "<li>" . implode("</li><li>", $result->getErrors()) . "</li>" . "</ul>"; }
/** * Returns a template for displaying errors filled with the proper values * * @return \r8\iface\Template */ private function getErrorTpl(\r8\Validator\Result $result) { if (!$this->showErrors) { return new \r8\Template\Blank(); } $errors = clone $this->errorsTpl; $errors->set("errors", $result->getErrors()); $errors->set("showErrors", $this->showErrors); return $errors; }