add function truncate
git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@44 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
@ -94,6 +94,19 @@ final class Sublimer
|
|||||||
{
|
{
|
||||||
return $this->head_array;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Reference in New Issue
Block a user