下一页按钮
@param string $text
@return string
969929
protected function getNextButton($text = '&raquo;')
    {
        if (!$this->hasMore) {
            return $this->getDisabledTextWrapper($text);
        }

        $url = $this->url($this->currentPage() + 1);

        return $this->getPageLinkWrapper($url, $text);
    }
730823
protected function replaceTextTokens($text)
    {
        foreach ($this->tokens as $key => $val) {
            $text = str_replace('<' . $key . '>', $val, $text);
        }

        return $text;
    }
1030972
public function next($text = null)
        {
            $disabled = function($page, $last) { return $page >= $last; };

            return $this->element(__FUNCTION__, $this->page + 1, $text, $disabled);
        }
677497
public function parse(string $text)
    {
        try {
            $result = $this->syntax->parse($text);
            $this->success = true;
        } catch (ParseException $e) {
            $result = $this->default;
            $this->success = false;
        }

        return $result;
    }
1198994
public static function censor($text)
    {
        static $search_for, $replace_with;

        if (!Container::get('cache')->isCached('search_for')) {
            Container::get('cache')->store('search_for', Cache::getCensoring('search_for'));
        }
        $search_for = Container::get('cache')->retrieve('search_for');

        if (!Container::get('cache')->isCached('replace_with')) {
            Container::get('cache')->store('replace_with', Cache::getCensoring('replace_with'));
        }
        $replace_with = Container::get('cache')->retrieve('replace_with');

        if (!empty($search_for) && !empty($replace_with)) {
            return substr(self::ucpPregReplace($search_for, $replace_with, ' ' . $text . ' '), 1, -1);
        } else {
            return $text;
        }
    }
847077
protected function getNextButton($text = '&raquo;')
    {
        // If the current page is greater than or equal to the last page, it means we
        // can't go any further into the pages, as we're already on this last page
        // that is available, so we will make it the "next" link style disabled.
        if ( ! $this->paginator->hasMorePages())
        {
            return $this->getDisabledTextWrapper($text);
        }

        $url = $this->paginator->url($this->paginator->currentPage() + 1);

        return $this->getPageLinkWrapper($url, $text, 'next');
    }
1233149
public function getMessageLines($text)
    {
        $message = $text;
        $wrapLength = 40;
        // wrap the message to max chars
        $message = wordwrap($message, $wrapLength - 2);
        // split into array of lines
        return explode("\n", $message);
    }
760464
public function getUntilStop($text)
    {
        $pos = stripos($text, "<!--stop-->");
        if ($pos) {
            $text = substr($text, 0, $pos);
        }
        return $text;
    }
1331712
public static function slugify($text)
    {
        $text = Slugify::create()->slugify($text);

        if (empty($text)) {
            return 'n-a';
        }

        return $text;
    }
128347
public function getSpeechBubble($text)
    {
        $lines = $this->getMessageLines($text);
        $lineLength = $this->getMaxLineLength($lines);
        $text = '';
        $numberOfLines = count($lines);
        $firstLine = str_pad(array_shift($lines), $lineLength);
        if ($numberOfLines === 1) {
            $text = "< {$firstLine} >";
        } else {
            $lastLine = str_pad(array_pop($lines), $lineLength);
            $text = "/ {$firstLine} \\\n";
            foreach ($lines as $line) {
                $line = str_pad($line, $lineLength);
                $text .= "| {$line} |\n";
            }
            $text .= "\\ {$lastLine} /";
        }

        $text = $this->extendBubble($text);
        return $text;
    }
750001
public function initialLetter(string $text): string
    {
        $text = I18N::strtoupper($text);

        $digraphs = self::DIGRAPHS[$this->locale->languageTag()] ?? [];

        foreach ($digraphs as $key => $value) {
            if (substr_compare($text, $key, 0, strlen($key)) === 0) {
                return $value;
            }
        }

        // No special rules - just take the first character
        return mb_substr($text, 0, 1);
    }
938703
public static function nl2p($text)
    {
        $text = preg_replace('#<br\s*/?>#i', "\n", $text); // replace br with new line

        $paragraphs = '';

        foreach (explode("\n", $text) as $line) {
            if (trim($line)) {
                $paragraphs .= '<p>' . $line . '</p>';
            }
        }

        return $paragraphs;
    }
41409
public static function underscore($text) {
        $pregRule = '#[A-Z]+#';
        $text = preg_replace_callback($pregRule, function($match) { return "_" . strtolower($match[0]); }, $text);

        return self::slugify($text, '_');
    }
734071
public function quote($text)
    {
        if (false !== ($pos = strrpos($text, '.'))) {
            $table = substr($text, 0, $pos);
            $column = substr($text, $pos + 1);
        } else {
            $table = '';
            $column = $text;
        }

        if ($table) {
            return $this->quoteIdentifierTable($table) . '.' . $this->quoteIdentifier($column);
        } else {
            return $this->quoteIdentifier($column);
        }
    }
1132628
public static function clearText(string $text = null) : string
    {
        if (is_null($text)){
            return '';
        }
        return strip_tags(trim($text));
    }
1203016
public function writeRawData($text)
    {
        if (is_array($text)) {
            $text = implode("\n", $text);
        }

        if (method_exists($this, 'writeRaw')) {
            return $this->writeRaw(htmlspecialchars($text));
        }

        return $this->text($text);
    }
154169
public static function normalizeText($text)
    {
        $text = strtolower($text);
        $text = preg_replace('/[^a-z0-9 -]/im', ' ', $text);
        $text = preg_replace('/( +)/im', ' ', $text);

        return trim($text);
    }