Menu


How to crop texts preserving whole words and strip HTML



If you need to crop a text to a certain length, also make the crop preserve whole words and strip HTML you can do this from your TYPO3 extension in the following manner:

$short=$this->cObj->stdWrap($row['bodytext'], array('crop' => '200|...|1', 'stripHtml'=>1));


The magic that does this is $this->cObj->stdWrap where the first parameter is the string and the second one the configuration array for the crop and strip html.





Google Search

 
wiki.lacisoft.com
WWW
2009-2011 (c) Lacisoft.com