Source for file outputfilter.trimwhitespace.php
Documentation is available at outputfilter.trimwhitespace.php
* Smarty trimwhitespace outputfilter plugin
* File: outputfilter.trimwhitespace.php<br>
* Name: trimwhitespace<br>
* Purpose: trim leading white space and blank lines from
* template source after it gets interpreted, cleaning
* up code and saving bandwidth. Does not affect
* <<PRE>></PRE> and <SCRIPT></SCRIPT> blocks.<br>
* Install: Drop into the plugin directory, call
* <code>$smarty->load_filter('output','trimwhitespace');</code>
* @author Monte Ohrt <monte@ispi.net>
* @author Contributions from Lars Noschinski <lars@usenet.noschinski.de>
// Pull out the script blocks
$_script_blocks = $match[0 ];
'@@@SMARTY:TRIM:SCRIPT@@@', $source);
// Pull out the pre blocks
$_pre_blocks = $match[0 ];
'@@@SMARTY:TRIM:PRE@@@', $source);
// Pull out the textarea blocks
$_textarea_blocks = $match[0 ];
'@@@SMARTY:TRIM:TEXTAREA@@@', $source);
// remove all leading spaces, tabs and carriage returns NOT
// preceeded by a php close tag.
// replace textarea blocks
for ($_i=0 , $_count= count($replace); $_i< $_count; $_i++ )
if (($_pos= strpos($subject, $search_str, $_pos))!==false )
Documentation generated on Mon, 25 Jun 2007 14:03:33 -0400 by phpDocumentor 1.3.2. PEAR Logo Copyright © PHP Group 2004.
|