remove {{^ handler

This commit is contained in:
fzerorubigd 2012-10-28 19:31:19 +03:30
parent 510ba18a37
commit 8db6b089ca

View File

@ -21,11 +21,13 @@
/** /**
* Handlebars parser (infact its a mustache parser) * Handlebars parser (infact its a mustache parser)
* This class is responsible for turning raw template source into a set of Mustache tokens. * This class is responsible for turning raw template source into a set of Mustache tokens.
* Some minor changes to handle Handlebars instead of Mustache
* *
* @category Xamin * @category Xamin
* @package Handlebars * @package Handlebars
* @author Justin Hileman <dontknow@example.org> * @author Justin Hileman <dontknow@example.org>
* @copyright 2012 Justin Hileman * @copyright 2012 Justin Hileman
* @author fzerorubigd <fzerorubigd@gmail.com>
* @license MIT <http://opensource.org/licenses/mit-license.php> * @license MIT <http://opensource.org/licenses/mit-license.php>
* @version Release: @package_version@ * @version Release: @package_version@
* @link http://xamin.ir * @link http://xamin.ir
@ -40,7 +42,7 @@ class Handlebars_Tokenizer
// Token types // Token types
const T_SECTION = '#'; const T_SECTION = '#';
const T_INVERTED = '^'; //Must remove this //const T_INVERTED = '^'; //Must remove this
const T_END_SECTION = '/'; const T_END_SECTION = '/';
const T_COMMENT = '!'; const T_COMMENT = '!';
const T_PARTIAL = '>'; //Maybe remove this partials and replace them with helpers const T_PARTIAL = '>'; //Maybe remove this partials and replace them with helpers
@ -54,7 +56,7 @@ class Handlebars_Tokenizer
// Valid token types // Valid token types
private static $_tagTypes = array( private static $_tagTypes = array(
self::T_SECTION => true, self::T_SECTION => true,
self::T_INVERTED => true, //self::T_INVERTED => true,
self::T_END_SECTION => true, self::T_END_SECTION => true,
self::T_COMMENT => true, self::T_COMMENT => true,
self::T_PARTIAL => true, self::T_PARTIAL => true,
@ -154,7 +156,8 @@ class Handlebars_Tokenizer
default: default:
if ($this->tagChange($this->ctag, $text, $i)) { if ($this->tagChange($this->ctag, $text, $i)) {
if ($this->tagType == self::T_SECTION || $this->tagType == self::T_INVERTED) { // Sections (Helpers) can accept parameters
if ($this->tagType == self::T_SECTION /*|| $this->tagType == self::T_INVERTED*/) {
$newBuffer = explode(' ', trim($this->buffer), 2); $newBuffer = explode(' ', trim($this->buffer), 2);
$args = ''; $args = '';
if (count($newBuffer) == 2) { if (count($newBuffer) == 2) {