‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Html\HtmlCropper Class Reference
Inheritance diagram for TYPO3\CMS\Core\Html\HtmlCropper:

Public Member Functions

string crop (string $content, int $numberOfChars, string $replacementForEllipsis, bool $cropToSpace)
 

Detailed Description

Definition at line 23 of file HtmlCropper.php.

Member Function Documentation

◆ crop()

string TYPO3\CMS\Core\Html\HtmlCropper::crop ( string  $content,
int  $numberOfChars,
string  $replacementForEllipsis,
bool  $cropToSpace 
)

Implements "cropHTML" which is a modified "substr" function allowing to limit a string length to a certain number of chars (from either start or end of string) and having a pre/postfix applied if the string really was cropped.

Parameters
string$content‪The string to perform the operation on
int$numberOfChars‪Max number of chars of the string. Negative value means cropping from end of string.
string$replacementForEllipsis‪The pre/postfix string to apply if cropping occurs.
bool$cropToSpace‪If true then crop will be applied at nearest space.
Returns
‪string The processed input value.

Definition at line 37 of file HtmlCropper.php.