function HtmlDumper::dumpString
Overrides CliDumper::dumpString
File
-
vendor/
symfony/ var-dumper/ Dumper/ HtmlDumper.php, line 774
Class
- HtmlDumper
- HtmlDumper dumps variables as HTML.
Namespace
Symfony\Component\VarDumper\DumperCode
public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) : void {
if ('' === $str && isset($cursor->attr['img-data'], $cursor->attr['content-type'])) {
$this->dumpKey($cursor);
$this->line .= $this->style('default', $cursor->attr['img-size'] ?? '', []);
$this->line .= $cursor->depth >= $this->displayOptions['maxDepth'] ? ' <samp class=sf-dump-compact>' : ' <samp class=sf-dump-expanded>';
$this->endValue($cursor);
$this->line .= $this->indentPad;
$this->line .= \sprintf('<img src="data:%s;base64,%s" /></samp>', $cursor->attr['content-type'], base64_encode($cursor->attr['img-data']));
$this->endValue($cursor);
}
else {
parent::dumpString($cursor, $str, $bin, $cut);
}
}