@param string $html
@param string $text

@return static
507840
public function setBody($html, $text = null)
    {
        $this->_htmlBody = $html;
        $this->_textBody = $text;

        return $this;
    }
158377
protected function removeHtml($text)
    {
        if (!trim($text)) {
            return '';
        }

        // Remove Styles and Scripts
        $crawler = new Crawler($text);
        $crawler->filter('style, script')->each(function (Crawler $crawler) {
            foreach ($crawler as $node) {
                $node->parentNode->removeChild($node);
            }
        });
        $text = $crawler->html();

        // Remove HTML markup
        $result = strip_tags($text);

        // Decode HTML entities
        $result = trim(html_entity_decode($result, ENT_QUOTES));

        return $result;
    }
1164478
protected function removeHtml($text)
    {
        // Remove HTML markup
        $result = strip_tags($text);

        // Decode HTML entities
        $result = trim(html_entity_decode($result, ENT_QUOTES));

        return $result;
    }
1067513
public function msgText($text)
    {
        $this->isHTML(false);
        $text = self::html2text($text, true);
        $text = self::normalizeBreaks($text);
        $this->Body = $text;
    }
411736
static public function instance($text=null)
    {
        if ($text) {
            if (isset(static::$instances[$text])) {
                return static::$instances[$text];
            } else {
                $object = static::$instances[$text] = new static($text);
            }
        } else {
            $object = new static();
        }
        
        $object->setSize(300)->setPadding(10);
        
        return $object;
    }
1110809
public static function help($text, $htmlOptions = array())
    {
        $type = TbArray::popValue('type', $htmlOptions, self::HELP_TYPE_INLINE);
        self::addCssClass('help-' . $type, $htmlOptions);
        return self::tag($type === self::HELP_TYPE_INLINE ? 'span' : 'p', $htmlOptions, $text);
    }
1332126
public function setText($text)
    {
        if (!is_string($text)) {
            throw new InvalidArgumentException('string', 0);
        }

        $text = trim($text);

        if (strpos($text, '#') !== 0) {
            $text = '# ' . $text;
        }

        $this->text = $text;

        return $this;
    }
393795
public function loadHTML($string)
    {
        $this->html = (string) $string;
        $this->file = null;
        return $this;
    }
1263348
static public function linkUrls($text, array $attribs = array()) {
        $htmlAttribs = array();
        foreach ($attribs as $name => $value) {
            $htmlAttribs[] = $name . '="' . $value . '"';
        }
        $htmlAttribs = implode(' ', $htmlAttribs);
        $htmlAttribs = $htmlAttribs ? ' ' . $htmlAttribs : '';

        $regexpProtocol = "/(?:^|\s)((http|https|ftp):\/\/[^\s<]+[\w\/#])([?!,.])?(?=$|\s)/i";
        $regexpWww      = "/(?:^|\s)((www\.)[^\s<]+[\w\/#])([?!,.])?(?=$|\s)/i";

        $text = preg_replace($regexpProtocol, " <a href=\"\\1\"$htmlAttribs>\\1</a>\\3 ", $text);
        $text = preg_replace($regexpWww, " <a href=\"http://\\1\"$htmlAttribs>\\1</a>\\3 ", $text);
        return trim($text);
    }
1007413
public function text($text) {

        if(false === is_string($text)) {
            return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($text)), E_USER_ERROR);
        }

    	$this -> text = $text;

    	return $this;
    }
908764
public function staticPhp($text)
    {
        $textExplode      = explode('->', $text);
        $variableName     = str_replace('$', '', array_shift($textExplode));
        $variableVariable = $this->variables;

        if (isset($variableVariable[$variableName]) === false) {
            throw new \InvalidArgumentException(
                sprintf('variable %s does not exist', $variableName)
            );
        }

        $textExplode = array_map(
            function ($value) {
                return str_replace('()', '', $value);
            },
            $textExplode
        );

        $instance = $variableVariable[$variableName];
        $keys     = array_values($textExplode);
        $lastKey  = array_pop($keys);

        foreach ($textExplode as $key => $method) {
            if ($instance === null && $lastKey !== $key) {
                throw new \InvalidArgumentException(sprintf('method %s return null', $method));
            } elseif (false === method_exists($instance, $method)) {
                throw new \InvalidArgumentException(sprintf('method %s does not exist on %s', $method, $text));
            } else {
                $instance = $instance->$method();
            }
        }

        return $instance;
    }
326685
public function addHtml($html, $meta = array())
    {
        $objString = new StaticText($html, $meta);
        $objString->setMeta("parent", $this, true);
        $this->__fields->addObject($objString);

        return $objString;
    }
889045
private function set_text($text)
    {
        if(!!$text)
        {
            if(!!$this->text)
            {
                if(!!is_array($this->text))
                {
                    $this->text[] = $text;
                }
                else
                {
                    $this->text = array($this->text,$text);
                }
            }
            else
            {
                $this->text = $text;
            }
        }

        return $this;
    }
122034
public function setText(string $text)
    {
        $this
            ->getLexer()
            ->setText($text);
        $this->locator = null;
        return $this;
    }
874871
public function setHtml($html = null)
    {
        $html = trim($html);
        $this->html = 0 < strlen($html) ? $html : null;

        return $this;
    }
329552
public function setText($text, $html = false)
    {
        $this->value = $text;
        $this->html = $html;
        $this->ajaxvalue = "";
    }
895829
public function setText(string $text): self
    {
        $text = trim($text);
        if ('' === $text) {
            throw new Exception('The text can not be empty');
        }

        $this->text = $text;

        return $this;
    }