public function render($ret = false, $depth = 0, $indent = null, $errorIndent = null)
{
$output = parent::render(true, $depth, $indent);
$errors = null;
$container = $this->errorDisplay['container'];
$attribs = null;
foreach ($this->errorDisplay['attributes'] as $a => $v) {
$attribs .= ' ' . $a . '="' . $v . '"';
}
// Add error messages if there are any.
if (count($this->errors) > 0) {
foreach ($this->errors as $msg) {
if ($this->errorDisplay['pre']) {
$errors .= "{$indent}{$this->indent}<" . $container . $attribs . ">{$msg}</" . $container . ">\n{$errorIndent}";
} else {
$errors .= "{$errorIndent}{$indent}{$this->indent}<" . $container . $attribs . ">{$msg}</" . $container . ">\n";
}
}
}
$output = $this->errorDisplay['pre'] ? $errors . $output : $output . $errors;
return $output;
}