Beispiel #1
0
 /**
  * Truncate HTML by number of characters in a "word-safe" manor.
  *
  * @param  string $text
  * @param  int    $length in words
  * @param  string $ellipsis
  *
  * @return string
  */
 public static function safeTruncateHtml($text, $length = 25, $ellipsis = '...')
 {
     return Truncator::truncateWords($text, $length, $ellipsis);
 }
Beispiel #2
0
 /**
  * Truncate HTML by number of characters in a "word-safe" manor.
  *
  * @param  string $text
  * @param  int    $length
  *
  * @return string
  */
 public static function safeTruncateHtml($text, $length = 100)
 {
     return Truncator::truncate($text, $length, array('length_in_chars' => true, 'word_safe' => true));
 }