Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: patTemplate

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5
Source code for file /pattemplate/patTemplate/OutputFilter/StripWhitespace.php

Documentation is available at StripWhitespace.php

  1. <?PHP
  2. /**
  3.  * patTemplate StripWhitespace output filter
  4.  *
  5.  * $Id: StripWhitespace.php 47 2005-09-15 02:55:27Z rhuk $
  6.  *
  7.  * Will remove all whitespace and replace it with a single space.
  8.  *
  9.  * @package        patTemplate
  10.  * @subpackage    Filters
  11.  * @author        Stephan Schmidt <[email protected]>
  12.  */
  13.  
  14. // Check to ensure this file is within the rest of the framework
  15. defined('JPATH_BASE'or die();
  16.  
  17. /**
  18.  * patTemplate StripWhitespace output filter
  19.  *
  20.  * $Id: StripWhitespace.php 47 2005-09-15 02:55:27Z rhuk $
  21.  *
  22.  * Will remove all whitespace and replace it with a single space.
  23.  *
  24.  * @package        patTemplate
  25.  * @subpackage    Filters
  26.  * @author        Stephan Schmidt <[email protected]>
  27.  */
  28. {
  29.    /**
  30.     * filter name
  31.     *
  32.     * @access    protected
  33.     * @abstract
  34.     * @var    string 
  35.     */
  36.     var    $_name    =    'StripWhitespace';
  37.  
  38.    /**
  39.     * remove all whitespace from the output
  40.     *
  41.     * @access    public
  42.     * @param    string        data
  43.     * @return    string        data without whitespace
  44.     */
  45.     function apply$data )
  46.     {
  47.         $data str_replace"\n"' '$data );
  48.         $data preg_replace'/\s\s+/'' '$data );
  49.  
  50.         return $data;
  51.     }
  52. }
  53. ?>

Documentation generated on Mon, 05 Mar 2007 21:27:16 +0000 by phpDocumentor 1.3.1