Source code for file /pattemplate/patTemplate/Modifier/Wordwrapper.php
Documentation is available at Wordwrapper.php
* patTemplate modfifier Wordwrapper
* $Id: Wordwrapper.php 104 2004-04-09 17:59:36Z schst $
// Check to ensure this file is within the rest of the framework
* patTemplate modfifier Wordwrapper
* Wraps lines of long texts.
* Possible attributes are:
* See the PHP documentation for wordwrap() for
* @link http://www.php.net/manual/en/function.wordwrap.php
* @return string modified value
function modify( $value, $params =
array() )
if( !isset
( $params['width'] ) )
settype( $params['width'], 'integer' );
* character used for linebreaks
if( !isset
( $params['break'] ) )
* cut at the specified width
if( !isset
( $params['cut'] ) )
$params['cut'] =
($params['cut'] ===
'yes') ?
true :
false;
$value =
wordwrap( $value, $params['width'], $params['break'], $params['cut'] );
if( isset
( $params['nl2br'] ) &&
$params['nl2br'] ===
'yes' )
$value =
nl2br( $value );