/lib/jelix/plugins/tpl/common/block.stripws.php
PHP | 26 lines | 13 code | 1 blank | 12 comment | 1 complexity | 57ca2efdfba25ffa389b286abd410ce6 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
- <?php
- /**
- * @package jelix
- * @subpackage plugin
- * @author Hugues Magnier
- * @contributor
- * @copyright 2007 Hugues Magnier
- * @link http://www.jelix.org
- * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
- */
- /**
- * remove all extra whitespaces
- */
- function jtpl_block_common_stripws($compiler, $begin, $param=array()) {
- if($begin){
- $content = 'ob_start();';
- }
- else{
- $content = '
- $buffer = preg_replace(\'![\\t ]*[\\r\\n]+[\\t ]*!\', \'\', ob_get_contents());
- ob_end_clean();
- print $buffer;';
- }
- return $content;
- }