Display image tag from blob content.
Enhancement for HtmlHelper. Defaults to png image

Options:
- type: png, gif, jpg, ...

@param string $content Data in binary form
@param array $options Attributes
@return string HTML image tag
519020
public function imageFromBlob($content, array $options = []) {
		$options += ['type' => 'png'];
		$mimeType = 'image/' . $options['type'];

		$text = 'data:' . $mimeType . ';base64,' . base64_encode($content);

		return $this->formatTemplate('image', [
			'url' => $text,
			'attrs' => $this->templater()->formatAttributes($options, ['block', 'link'])
		]);
	}
1005256
public function serialize($content, array $options = [])
    {
        $node = $content->getResourceNode();

        if (!empty($node)) {
            $serialized = $this->resourceContentSerializer->serialize($node, $options);
        } else {
            $serialized = [
                'type' => 'text/html',
                'data' => $content->getData(),
            ];
        }

        return $serialized;
    }
619621
public function render($content, array $attribs = [])
    {
        if (isset($attribs['tagName'])) {
            $tagName = $attribs['tagName'];
            unset($attribs['tagName']);
        } else {
            $tagName = $this->getTagName();
        }

        if (!$tagName) {
            return $this->renderContent($content);
        }

        if (!$content && !$this->closeTag) {
            $openTag = trim($this->getOpenTag($tagName, $attribs));
            return substr_replace($openTag, $this->getClosingBracket(), -1);
        }

        return $this->getOpenTag($tagName, $attribs) .
            $this->renderContent($content) .
            $this->getCloseTag($tagName);
    }
1343398
public function display($content, $options = [])
    {
        if (!empty($options['meta']) || !empty($options['pageBuilder'])) {
            $content = preg_replace_callback(
                '/{{\s*\$(?P<block>\w*)\s*}}/',
                function ($matches) {
                    return str_replace('"', "'", strip_tags(PageBuilder::block($matches['block'])));
                },
                $content
            );
            $content = str_replace('%page_name%', PageBuilder::pageName(), $content);
            $content = str_replace('%site_name%', config('coaster::site.name'), $content);
        }
        if (!empty($options['meta'])) {
            $content = trim(str_replace(PHP_EOL, ' ', $content));
            $content = preg_replace('/\s+/', ' ', $content);
            $content = htmlentities(strip_tags(html_entity_decode($content, ENT_QUOTES, 'UTF-8')));
            $content = StringHelper::cutString($content);
        }
        return parent::display($content, $options);
    }
593522
public function contentTag($name, $content, array $options = array(), $escape = false)
    {
        if ($content instanceof \Closure) {
            ob_start();
            $ret     = $content();
            $content = ob_get_clean();
            if ($ret !== null) {
                $content = $ret;
            }
        }
        return $this->contentTagString($name, $content, $options, $escape);
    }
849742
public function html($content) {
        if (func_num_args() == 1) {
            $this->_data['fields'][] = $content;
            return $this;
        }
        $this->__attributes['fields'][$content] = func_get_arg(1);
        return $this;
    }
21079
public function data($content, $options = [])
    {
        if (isset($options['returnAll']) && $options['returnAll']) {
            return BlockSelectOption::getOptionsArray($this->_block->id);
        }
        return parent::data($content);
    }
821592
public static function badgeLabel($content, $options = [])
    {
        static::addCssClass($options, 'label');
        $color = ArrayHelper::remove($options, 'color', static::LABEL_DEFAULT);
        static::addCssClass($options, $color);
        return static::tag(ArrayHelper::remove($options, 'tag', 'span'), $content, $options);
    }
1278334
public function display($content, $options = [])
    {
        $formData = $this->_defaultData($content);
        $view = !empty($options['view']) ? $options['view'] : $formData->template;
        return FormWrap::view($this->_block, $options, $this->displayView($view), ['form_data' => $formData]);
    }
497821
public static function modalBody($content, $htmlOptions = array())
    {
        self::addCssClass('modal-body', $htmlOptions);
        return self::tag('div', $htmlOptions, $content);
    }
565664
public static function thumbnail($content, $htmlOptions = array())
    {
        $itemOptions = TbArray::popValue('itemOptions', $htmlOptions, array());
        self::addCssClass('thumbnail', $htmlOptions);
        $output = self::openTag('li', $itemOptions);
        $output .= self::tag('div', $htmlOptions, $content);
        $output .= '</li>';
        return $output;
    }
577828
public static function tag($name, $content = NULL, Array $attributes = NULL) {
    return \Psc\UI\HTML::tag($name, $content, $attributes);
  }
269258
public static function ul(
        string $content = null, 
        array $attributes = []
    ) : string
    {
        return self::tag("ul", $content, $attributes);
    }
1304193
public function table($content, $options = array())
    {
        if ('text' == $this->getType()) {
            return $content;
        }

        if (false === $options) {
            return $this->config('templates.tableend');
        }

        $tag = 'table';
        if (is_null($content)) {
            $tag = 'tablestart';
        }

        $templater = $this->templater();
        return $templater->format('table', [
        'attrs' => $templater->formatAttributes($this->_mergeAttributes($options, $this->config('attributes.table'))),
        'content' => $content
        ]);
    }
752836
public function setHTML($content, array $options = array()) {
        $this->html = $content;
        $this->htmlCharset = (isset($options['charset'])) ? $options['charset'] : 'utf-8';
        if (@$options['autoSetText']) {
            $this->setText(strip_tags($this->html), $this->htmlCharset);
        }
        return $this;
    }
602774
public static function table(
        string $content = null, 
        array $attributes = []
    ) : string
    {
        return self::tag("table", $content, $attributes);
    }
393806
public function uploadBase64(ImageInterface $image, $content, array $options = [])
    {
        $this
            ->tmpFile
            ->create()
            ->write(base64_decode($content));

        try {
            $image = $this->upload($image, $this->tmpFile->getPath(), $options);
        } finally {
            $this->tmpFile->clear();
        }

        return $image;
    }