protected function renderView(array $view)
    {
        foreach ($view as $key => $element) {
            if (empty($element['value'])) {
                $view[$key] = '';
                continue;
            }

            if (!empty($element['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;
    }
protected function renderView(array $view)
    {
        foreach ($view as $key => $element) {
            if (empty($element['value'])) {
                $view[$key] = '';
                continue;
            }

            if (!empty($element['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;
    }
protected function renderView ( array $ view ) { foreach ( $ view as $ key => $ element ) { if ( empty ( $ element [ 'value' ] ) ) { $ view [ $ key ] = '' ; continue ; } if ( ! empty ( $ element [ '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 ; }
Renders the given view.

@param array $view The view.

@return array An array of rendered values with the original keys preserved.
Renders the given view .