protected function renderView(array $view)
{
foreach ($view as $key => $element) {
if (empty($element['value'])) {
$view[$key] = '';
continue;
}
if (!empty($this->options['html'])) {
$attributes = $this->renderAttributes($element['html_attributes']);
$prefix = '<' . $element['html_tag'] . ' ' . $attributes . '>';
$suffix = '</' . $element['html_tag'] . '>';
$value = htmlspecialchars($element['value'], ENT_QUOTES, 'UTF-8');
$view[$key] = $prefix . $value . $suffix;
} else {
$view[$key] = strip_tags($element['value']);
}
}
return $view;
}