TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
CropViewHelper Class Reference
Inheritance diagram for CropViewHelper:
AbstractViewHelper

Public Member Functions

 initializeArguments ()
 
 render ()
 
- Public Member Functions inherited from AbstractViewHelper
 setRenderingContext (\TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 prepareArguments ()
 

Protected Attributes

 $escapeOutput = false
 
- Protected Attributes inherited from AbstractViewHelper
 $controllerContext
 
 $objectManager
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractViewHelper
 callRenderMethod ()
 
 getLogger ()
 
 registerRenderMethodArguments ()
 

Detailed Description

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="&nbsp;[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 64 of file fluid/Classes/ViewHelpers/Format/CropViewHelper.php.

Member Function Documentation

initializeArguments ( )

Initialize arguments.

Exceptions
TYPO3Fluid

Definition at line 79 of file fluid/Classes/ViewHelpers/Format/CropViewHelper.php.

render ( )

Render the cropped text.

Returns
string cropped text
Exceptions
InvalidArgumentException

Definition at line 93 of file fluid/Classes/ViewHelpers/Format/CropViewHelper.php.

Member Data Documentation

$escapeOutput = false
protected