Sha256: 368877316fd7e30ed8ab0b99f81a57d00fb0d1ee3d955168e10ef8217236e0d7

Contents?: true

Size: 917 Bytes

Versions: 3

Compression:

Stored size: 917 Bytes

Contents

<?php
/* SVN FILE: $Id: HamlEscapedFilter.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
/**
 * Escaped Filter for {@link http://haml-lang.com/ Haml} class file.
 * @author			Chris Yates <chris.l.yates@gmail.com>
 * @copyright		Copyright (c) 2010 PBM Web Development
 * @license			http://phamlp.googlecode.com/files/license.txt
 * @package			PHamlP
 * @subpackage	Haml.filters
 */

/**
 * Escaped Filter for {@link http://haml-lang.com/ Haml} class.
 * Escapes the text.
 * Code to be interpolated can be included by wrapping it in #().
 * @package			PHamlP
 * @subpackage	Haml.filters
 */
class HamlEscapedFilter extends HamlBaseFilter {
	/**
	 * Run the filter
	 * @param string text to filter
	 * @return string filtered text
	 */
	public function run($text) {
	  return preg_replace(
	  	HamlParser::MATCH_INTERPOLATION,
	  	'<?php echo htmlspecialchars($text); ?>',
	  	htmlspecialchars($text)
	  ) . "\n";
	}
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
frontsau-0.0.3 lib/Phamlp/haml/filters/HamlEscapedFilter.php
frontsau-0.0.2 lib/Phamlp/haml/filters/HamlEscapedFilter.php
frontsau-0.0.1 lib/Phamlp/haml/filters/HamlEscapedFilter.php