![]() |
TYPO3
7.6
|
Static Protected Member Functions | |
static | simulateFrontendEnvironment () |
static | resetFrontendEnvironment () |
Static Protected Attributes | |
static | $tsfeBackup |
Additional Inherited Members | |
![]() | |
static | renderStatic (array $arguments,\Closure $renderChildrenClosure,\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext) |
![]() | |
static | renderStatic (array $arguments,\Closure $renderChildrenClosure,\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext) |
![]() | |
registerArgument ($name, $type, $description, $required=false, $defaultValue=null) | |
overrideArgument ($name, $type, $description, $required=false, $defaultValue=null) | |
callRenderMethod () | |
getLogger () | |
buildRenderChildrenClosure () | |
hasArgument ($argumentName) | |
![]() | |
$arguments | |
$templateVariableContainer | |
$controllerContext | |
$renderingContext | |
$renderChildrenClosure = null | |
$viewHelperVariableContainer | |
$objectManager | |
$escapingInterceptorEnabled = true | |
Use this view helper to crop the text between its opening and closing tags.
= Examples =
<f:format.crop maxCharacters="10">This is some very long text</f:format.crop>
<output> This is... </output>
<f:format.crop maxCharacters="17" append=" [more]">This is some very long text</f:format.crop>
<output> This is some [more] </output>
<f:format.crop maxCharacters="10" respectWordBoundaries="false">This is some very long text</f:format.crop>
<output> This is so... </output>
<f:format.crop maxCharacters="28" respectWordBoundaries="false" respectHtml="false">This is some text with HTML tags</f:format.crop>
<output> This is some text with <stro </output>
{someLongText -> f:format.crop(maxCharacters: 10)}
<output> someLongText cropped after 10 characters... (depending on the value of {someLongText}) </output>
Definition at line 65 of file fluid/Classes/ViewHelpers/Format/CropViewHelper.php.
render | ( | $maxCharacters, | |
$append = '...' , |
|||
$respectWordBoundaries = true , |
|||
$respectHtml = true |
|||
) |
Render the cropped text
int | $maxCharacters | Place where to truncate the string |
string | $append | What to append, if truncation happened |
bool | $respectWordBoundaries | If TRUE and division is in the middle of a word, the remains of that word is removed. |
bool | $respectHtml | If TRUE the cropped string will respect HTML tags and entities. Technically that means, that cropHTML() is called rather than crop() |
Definition at line 81 of file fluid/Classes/ViewHelpers/Format/CropViewHelper.php.
References AbstractViewHelper\buildRenderChildrenClosure().
|
staticprotected |
Resets $GLOBALS['TSFE'] if it was previously changed by simulateFrontendEnvironment()
Definition at line 167 of file fluid/Classes/ViewHelpers/Format/CropViewHelper.php.
References $GLOBALS.
|
staticprotected |
Sets the global variables $GLOBALS['TSFE']->csConvObj and $GLOBALS['TSFE']->renderCharset in Backend mode This somewhat hacky work around is currently needed because the crop() and cropHTML() functions of ContentObjectRenderer rely on those variables to be set
Definition at line 139 of file fluid/Classes/ViewHelpers/Format/CropViewHelper.php.
References $GLOBALS, and GeneralUtility\makeInstance().
|
staticprotected |
Definition at line 70 of file fluid/Classes/ViewHelpers/Format/CropViewHelper.php.