diff --git a/classes/Sublimer.class.php b/classes/Sublimer.class.php index 855cd14..13284d0 100644 --- a/classes/Sublimer.class.php +++ b/classes/Sublimer.class.php @@ -94,6 +94,19 @@ final class Sublimer { return $this->head_array; } + + /** + * обрезает текст до заданной длинны + * + * @param string $text + * @param int $count + * @param string $postfix + */ + protected function trimString($text, $count = 15, $postfix = "...") + { + return mb_substr($text, 0, $count).$postfix; + } + } ?> \ No newline at end of file