private function renderTag($tag, $content = null, array $attributes = [])
    {
        $attr = [];

        foreach ($attributes as $key => $value) {
            $attr[] = sprintf(' %s="%s"', $key, $value);
        }

        if (0 < strlen($content)) {
            return sprintf('<%s%s>%s</%s>', $tag, implode('', $attr), $content, $tag);
        } else {
            return sprintf('<%s%s />', $tag, implode('', $attr));
        }
    }
private function renderTag($tag, $content = null, array $attributes = [])
    {
        $attr = [];

        foreach ($attributes as $key => $value) {
            $attr[] = sprintf(' %s="%s"', $key, $value);
        }

        if (0 < strlen($content)) {
            return sprintf('<%s%s>%s</%s>', $tag, implode('', $attr), $content, $tag);
        } else {
            return sprintf('<%s%s />', $tag, implode('', $attr));
        }
    }
private function renderTag ( $ tag , $ content = null , array $ attributes = [ ] ) { $ attr = [ ] ; foreach ( $ attributes as $ key => $ value ) { $ attr [ ] = sprintf ( ' %s="%s"' , $ key , $ value ) ; } if ( 0 < strlen ( $ content ) ) { return sprintf ( '<%s%s>%s</%s>' , $ tag , implode ( '' , $ attr ) , $ content , $ tag ) ; } else { return sprintf ( '<%s%s />' , $ tag , implode ( '' , $ attr ) ) ; } }
Renders the html tag.

@param        $tag
@param string $content
@param array  $attributes

@return string
Renders the html tag .