Оформление значения
@param $var
@param bool $html
@return string
519680
static private function style($var, $html = true)
    {
        $style='';
        if (is_string($var)){
            $style.='color:#008100;';
            $var = '\''.($html ? htmlspecialchars($var, ENT_COMPAT, 'UTF-8') : $var).'\'';
        }else
        if (is_numeric($var)||is_nan($var)){
            $style.='color:#FF0000;';
        }else
        if (is_bool($var)||is_null($var)){
            $style.='color:#252FFF;';
            if (is_bool($var)) $var = $var ? 'true' : 'false';
            if (is_null($var)) $var = 'null';
        }else{
            return $var;
        }
        return $html ? '<span style="'.$style.'">'.$var.'</span>' : $var;
    }
1211571
public function html($tag, $value = null, array $attributes = array()) {
        // This happens when used from a Garp_Form context
        if (array_key_exists('id', $attributes) && !$attributes['id']) {
            unset($attributes['id']);
        }
        if (isset($attributes['tag'])) {
            $tag = $attributes['tag'];
            unset($attributes['tag']);
        }
        $escape = true;
        if (array_key_exists('escape', $attributes)) {
            $escape = $attributes['escape'];
            unset($attributes['escape']);
        }

        $html  = '<' . $tag;
        $html .= $this->_htmlAttribs($attributes) . '>';
        if ($value) {
            if ($escape) {
                $value = $this->view->escape($value);
            }
            $html .= $value;
        }
        $html .= '</' . $tag . '>';
        return $html;
    }
1051953
public function antispam(string $string, bool $html = true): string
    {
        if ($html) {
            return preg_replace_callback(self::MAIL_HTML_PATTERN, [$this, 'encryptMail'], $string) ?: '';
        }

        return preg_replace_callback(self::MAIL_TEXT_PATTERN, [$this, 'encryptMailText'], $string) ?: '';
    }
912202
public function getHtml($variable, $default = '', $allowed = "", $escape = true)
    {
        return (string) rawurldecode($this->get($variable, $default, $allowed, $escape));
    }
375578
protected function _convertUrls($html) {
		$fullBaseUrl = Configure::read('App.fullBaseUrl');
		if (!empty($fullBaseUrl)) {
			$html = preg_replace('~(?:src|action|href)=[\'"]\K/(?!/)[^\'"]*~', "$fullBaseUrl$0", $html);
		}

		return $html;
	}
801526
protected function encode($var)
    {
        $string = '';
        foreach ($var as $key => $value) {
            $string .= $key . '="' .  preg_replace(
                    ['/"/', '/\\\/', "/\t/", "/\n/", "/\r/"],
                    ['\"',  '\\\\', '\t',   '\n',   '\r'],
                    $value
                ) . "\"\n";
        }
        return $string;
    }
1039256
public static function debug($variable)
    {
        ob_start();
        var_dump($variable);
        $output = ob_get_clean();
        $maps = ['string' => "/(string\((?P<length>\d+)\)) (?P<value>\"(?<!\\\).*\")/i", 'array' => "/\[\"(?P<key>.+)\"(?:\:\"(?P<class>[a-z0-9_\\\]+)\")?(?:\:(?P<scope>public|protected|private))?\]=>/Ui", 'countable' => "/(?P<type>array|int|string)\((?P<count>\d+)\)/", 'resource' => "/resource\((?P<count>\d+)\) of type \((?P<class>[a-z0-9_\\\]+)\)/", 'bool' => "/bool\((?P<value>true|false)\)/", 'float' => "/float\((?P<value>[0-9\.]+)\)/", 'object' => "/object\((?P<class>\S+)\)\#(?P<id>\d+) \((?P<count>\d+)\)/i"];
        foreach ($maps as $function => $pattern) {
            $output = preg_replace_callback($pattern, function ($matches) use ($function) {
                switch ($function) {
                    case 'string':
                        $matches['value'] = htmlspecialchars($matches['value']);

                        return '<span style="color: #0000FF;">string</span>(<span style="color: #1287DB;">'.$matches['length'].')</span> <span style="color: #6B6E6E;">'.$matches['value'].'</span>';

                    case 'array':
                        $key = '<span style="color: #008000;">"'.$matches['key'].'"</span>';
                        $class = '';
                        $scope = '';
                        if (isset($matches['class']) && !empty($matches['class'])) {
                            $class = ':<span style="color: #4D5D94;">"'.$matches['class'].'"</span>';
                        }
                        if (isset($matches['scope']) && !empty($matches['scope'])) {
                            $scope = ':<span style="color: #666666;">'.$matches['scope'].'</span>';
                        }

                        return '['.$key.$class.$scope.']=>';

                    case 'countable':
                        $type = '<span style="color: #0000FF;">'.$matches['type'].'</span>';
                        $count = '(<span style="color: #1287DB;">'.$matches['count'].'</span>)';

                        return $type.$count;

                    case 'bool':
                        return '<span style="color: #0000FF;">bool</span>(<span style="color: #0000FF;">'.$matches['value'].'</span>)';

                    case 'float':
                        return '<span style="color: #0000FF;">float</span>(<span style="color: #1287DB;">'.$matches['value'].'</span>)';

                    case 'resource':
                        return '<span style="color: #0000FF;">resource</span>(<span style="color: #1287DB;">'.$matches['count'].'</span>) of type (<span style="color: #4D5D94;">'.$matches['class'].'</span>)';

                    case 'object':
                        return '<span style="color: #0000FF;">object</span>(<span style="color: #4D5D94;">'.$matches['class'].'</span>)#'.$matches['id'].' (<span style="color: #1287DB;">'.$matches['count'].'</span>)';

                }
            }, $output);
        }
        $header = '';
        list($debugfile) = debug_backtrace();

        if (!empty($debugfile['file'])) {
            $header = '<h4 style="border-bottom:1px solid #bbb;font-weight:bold;margin:0 0 10px 0;padding:3px 0 10px 0">'.$debugfile['file'].'</h4>';
        }

        echo '<pre style="background-color: #CDDCF4;border: 1px solid #bbb;border-radius: 4px;-moz-border-radius:4px;-webkit-border-radius\:4px;font-size:12px;line-height:1.4em;margin:30px;padding:7px">'.$header.$output.'</pre>';
    }
538135
public function convert($html)
    {
        $html = parent::convert((string) $html);

        $html = $this->encode('--', '-', $html, false);
        $html = $this->encode('\#', '#', $html);
        $html = $this->encode('\*', '*', $html);
        $html = $this->encode('\_', '_', $html);
        $html = $this->encode('•', '*', $html);
        $html = $this->encode('…', '...', $html);

        $html = $this->encode('\[', '[', (string) $html);
        $html = $this->encode('\]', ']', (string) $html);
        $html = str_replace(array('—', '–', '\-'), '-', $html);
        $html = str_replace(array('“', '”'), '"', $html);
        $html = str_replace(array('’', '‘'), "'", $html);
        $html = str_replace("\n\n\n", "\n\n", $html);
        $html = str_replace("\n ", "\n", (string) $html);

        return str_replace('\.', '.', (string) $html);
    }
1297648
public function setHtml(string $html): Response
    {
        if ($this->response_finished) {
            return $this;

        }

        $this->response_html = $html;

        return $this;
    }
58194
public static function nl2br(string $string, bool $xhtml = false): string
	{
		return str_replace(["\r\n", "\n\r", "\n", "\r"], (new HTML($xhtml))->tag('br'), $string);
	}
294044
public function eTag($var = null)
    {
        if ($var !== null) {
            $this->etag = $var;
        }
        if (!isset($this->etag)) {
            $this->etag = (bool)Grav::instance()['config']->get('system.pages.etag');
        }

        return $this->etag;
    }
958651
public function status($html = false) {
		$msg = $this->run("status");
		if ($html == true) {
			$msg = str_replace("\n", "<br />", $msg);
		}
		return $msg;
	}
1188414
public function convertToString($html)
    {
        $externalJavaScript = $this->extractExternalJavaScript($html);

        return $this->replaceJavaScriptTags($html, $externalJavaScript);
    }
798308
public function toHtml(bool $preview = false)
    {
        $html = '';
        if ($preview) {
            if ($this->getImageUrl()) {
                $html = "<img src='{$this->getImageUrl()}' style='max-width: 100%;' />";
            }
        }
        if ($this->getVideoUrl()) {
            $html = "<iframe src='{$this->getVideoUrl()}' frameborder='0' allowfullscreen></iframe>";
        }

        return $html;
    }
713264
public static function phpArray($var, $varname = 'varName', $isReturn = false)
    {
        if (!self::isDebug()) {
            return false;
        }

        $output = JBDump_array2php::toString($var, $varname);
        if ($isReturn) {
            return $output;
        }

        $_this = self::i();
        $_this->_dumpRenderHtml($output, $varname, $params);

        return $_this;
    }
1069863
public static function dump($var, array $options = null)
    {
        if (Helpers::isHtmlMode()) {
            echo self::toHtml($var, $options);
        } elseif (self::detectColors()) {
            echo self::toTerminal($var, $options);
        } else {
            echo self::toText($var, $options);
        }

        return $var;
    }
265329
public static function tag($tag, $attr = [], $html = '')
    {
        // Build attributes
        $attributes = [];
        foreach ($attr as $name => $value) {
            $attributes[] = $name.'="'.$value.'"';
        }

        if (in_array($tag, self::$voidElements)) {
            return '<'.$tag.(!empty($attributes) ? ' '.implode(' ', $attributes) : '').'>';
        } else {
            return '<'.$tag.(!empty($attributes) ? ' '.implode(' ', $attributes) : '').'>'.$html.'</'.$tag.'>';
        }
    }