Generates a quote.
@param string $text the quoted text.
@param array $htmlOptions additional HTML attributes.
@return string the generated quote.
552910
public static function quote($text, $htmlOptions = array())
    {
        $paragraphOptions = TbArray::popValue('paragraphOptions', $htmlOptions, array());
        $source = TbArray::popValue('source', $htmlOptions);
        $sourceOptions = TbArray::popValue('sourceOptions', $htmlOptions, array());
        $cite = TbArray::popValue('cite', $htmlOptions);
        $citeOptions = TbArray::popValue('citeOptions', $htmlOptions, array());
        $cite = isset($cite) ? ' ' . self::tag('cite', $citeOptions, $cite) : '';
        $source = isset($source) ? self::tag('small', $sourceOptions, $source . $cite) : '';
        $text = self::tag('p', $paragraphOptions, $text) . $source;
        return self::tag('blockquote', $htmlOptions, $text);
    }
905841
public function createBlockquote($text = null)
    {
        $blockquote = new Blockquote();

        if (isset($text)) {
            $blockquote->setParagraph($text);
        }

        $this->childNodes->push($blockquote);

        return $this->childNodes->last();
    }
1067513
public function msgText($text)
    {
        $this->isHTML(false);
        $text = self::html2text($text, true);
        $text = self::normalizeBreaks($text);
        $this->Body = $text;
    }
700956
protected static function getColClasses($htmlOptions)
    {
        // todo: why would you want to do this
        $colClasses = array();
        if (isset($htmlOptions['class']) && !empty($htmlOptions['class'])) {
            $classes = explode(' ', $htmlOptions['class']);
            foreach ($classes as $class) {
                if (substr($class, 0, 4) == 'col-') {
                    $colClasses[] = $class;
                }
            }
        }
        return implode(' ', array_unique($colClasses));
    }
362245
public static function activeTextArea($model, $attribute, $htmlOptions = array())
    {
        $htmlOptions = self::normalizeInputOptions($htmlOptions);
        return parent::activeTextArea($model, $attribute, $htmlOptions);
    }
1362193
private function getInfoTextLine($options)
    {
        $htmlForm = '';

        if (isset($options['info'])) {
            $class = isset($options['info']['class']) ? $options['info']['class'] : 'info';
            $htmlForm .= '<p class="text-'.$class.' small">'.$options['info']['text'].'</p>';
        }

        return $htmlForm;
    }
905072
public static function well($content, $htmlOptions = array())
    {
        self::addCssClass('well', $htmlOptions);
        $size = TbArray::popValue('size', $htmlOptions);
        if (!empty($size)) {
            self::addCssClass('well-' . $size, $htmlOptions);
        }
        return self::tag('div', $htmlOptions, $content);
    }
616269
public function addText($text) {
		$content = new HtmlString();
		$content->htmlString = $text;
		$this->children[] = $content;
		return $this;
	}
1065008
public static function controls($controls, $htmlOptions = array())
    {
        if (TbArray::popValue('row', $htmlOptions, false)) {
            self::addCssClass('row', $htmlOptions);
        }
        $before = TbArray::popValue('before', $htmlOptions, '');
        $after = TbArray::popValue('after', $htmlOptions, '');
        if (is_array($controls)) {
            $controls = implode('', $controls);
        }
        $content = $before . $controls . $after;
        return self::tag('div', $htmlOptions, $content);
    }
739226
public static function toText($html, bool $ignoreErrors = false): string
    {
        return (string) (new \Html2Text\Html2Text())->convert((string) $html, $ignoreErrors);
    }
1198620
public static function textArea($name, $value = '', $htmlOptions = array())
    {
        $htmlOptions = self::normalizeInputOptions($htmlOptions);
        return parent::textArea($name, $value, $htmlOptions);
    }
956317
public function setHtmlBody($text) {
    if (!is_string($text)) {
      $error = sprintf("HTML text given is not a string (Actual type: %s).",
                       gettype($text));
      throw new \InvalidArgumentException($error);
    }
    $this->message->setHtmlbody($text);
  }
832878
public static function helpBlock($text, $htmlOptions = array())
    {
        $htmlOptions['type'] = self::HELP_TYPE_BLOCK;
        return self::help($text, $htmlOptions);
    }
1198873
public function image($text, array $options = []) {
		return $this->Html->image($this->uri($text), $options);
	}
845864
protected function generateTextarea($options, $currentValue = null)
    {
        $value = is_null($currentValue) ? $options['value'] : $currentValue;

        unset($options['value']);
        unset($options["type"]);

        return sprintf('<textarea %s>%s</textarea>', $this->arrayToHtmlAttributes($options), stripslashes($value));
    }
489175
public function quoteIdentifier($text)
    {
        if (!$this->getPlatform()) {
            throw new RuntimeException('No platform specified. Can not quote without knowing which platform this table\'s database is using.');
        }

        if ($this->isIdentifierQuotingEnabled()) {
            return $this->getPlatform()->doQuoting($text);
        }

        return $text;
    }
601657
public static function replaceStringsAndComments($text)
    {
        if (is_string($text)) {
            // Fast pre-check, to optimize performance
            if (strpos($text, "'") !== false || strpos($text, '"') !== false) {
                // Replace all strings in quotes (also in comments, but that's okay - removed in next step)
                $replaceStringCallback = function ($matches) {
                    return self::addStringReplacement($matches[1] . $matches[2] . $matches[1]);
                };
                $text = preg_replace('/\r/', '', $text);
                $text = preg_replace('/\\\\\n/', '_STRING_CSSLINEBREAK_', $text);
                $text = preg_replace('/\\\\"/', '_STRING_ESCAPEDDOUBLEQUOTE_', $text);
                $text = preg_replace('/\\\\\'/', '_STRING_ESCAPEDSINGLEQUOTE_', $text);
                $text = preg_replace_callback('/("|\')(.*?)\g{1}/', $replaceStringCallback, $text);
            }

            if (strpos($text, "data:") !== false) {
                // Replace all data URIs
                // (that are not in quotes and therefor were not replaced by the previous check)
                $replaceDataUriCallback = function ($matches) {
                    return self::addStringReplacement($matches[1]);
                };
                $text = preg_replace_callback(
                    '/(data:(?:[^;,]+)?(?:;charset=[^;,]+)?' .
                    '(?:;base64,(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?|,[-.a-zA-Z0-9_%]+))/',
                    $replaceDataUriCallback,
                    $text
                );
            }

            // Fast pre-check, to optimize performance
            if (strpos($text, "*") !== false) {
                // Strip multi-line comments (after string replace to keep comments in strings)
                $replaceCommentCallback = function ($matches) {
                    return self::addCommentReplacement($matches[1]);
                };
                $text = preg_replace_callback('/(\/\*.*?\*\/)/', $replaceCommentCallback, $text);
            }

            return $text;
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($text). "' for argument 'text' given."
            );
        }
    }