예제 #1
0
 /**
  * Constructor
  *
  * @param string $markup
  * @param array $tokens
  * @param FileSystem $fileSystem
  *
  * @throws \Liquid\LiquidException
  */
 public function __construct($markup, array &$tokens, FileSystem $fileSystem = null)
 {
     $this->nodelists = array();
     $this->elseNodelist = array();
     parent::__construct($markup, $tokens, $fileSystem);
     $syntaxRegexp = new Regexp('/' . Liquid::get('QUOTED_FRAGMENT') . '/');
     if ($syntaxRegexp->match($markup)) {
         $this->left = $syntaxRegexp->matches[0];
     } else {
         throw new LiquidException("Syntax Error in tag 'case' - Valid syntax: case [condition]");
         // harry
     }
 }
예제 #2
0
 /**
  * Constructor
  *
  * @param string $markup
  * @param array $tokens
  * @param FileSystem $fileSystem
  */
 public function __construct($markup, array &$tokens, FileSystem $fileSystem = null)
 {
     $this->nodelist =& $this->nodelistHolders[count($this->blocks)];
     array_push($this->blocks, array('if', $markup, &$this->nodelist));
     parent::__construct($markup, $tokens, $fileSystem);
 }