/**
  * Constructor
  *
  * @param string $markup
  * @param Array $tokens
  * @param LiquidFileSystem $fileSystem
  * @return CaptureLiquidTag
  */
 public function __construct($markup, &$tokens, &$fileSystem)
 {
     $syntaxRegexp = new LiquidRegexp('/(\\w+)/');
     if ($syntaxRegexp->match($markup)) {
         $this->_block = $syntaxRegexp->matches[1];
         parent::__construct($markup, $tokens, $fileSystem);
     } else {
         throw new LiquidException("Syntax Error in 'block' - Valid syntax: block [name]");
     }
 }
 /**
  * Constructor
  *
  * @param string $markup
  * @param Array $tokens
  * @param LiquidFileSystem $file_system
  * @return CaptureLiquidTag
  */
 public function __construct($markup, &$tokens, &$file_system)
 {
     $syntax_regexp = new LiquidRegexp('/(\\w+)/');
     if ($syntax_regexp->match($markup)) {
         $this->_to = $syntax_regexp->matches[1];
         parent::__construct($markup, $tokens, $file_system);
     } else {
         throw new LiquidException("Syntax Error in 'capture' - Valid syntax: assign [var] = [source]");
         // harry
     }
 }
 /**
  * Constructor
  *
  * @param string $markup
  * @param array $tokens
  * @param LiquidFileSystem $file_system
  * @return TableRowLiquidTag
  */
 public function __construct($markup, &$tokens, &$file_system)
 {
     parent::__construct($markup, $tokens, $file_system);
     $syntax = new LiquidRegexp("/(\\w+)\\s+in\\s+(" . LIQUID_ALLOWED_VARIABLE_CHARS . "+)/");
     if ($syntax->match($markup)) {
         $this->variable_name = $syntax->matches[1];
         $this->collection_name = $syntax->matches[2];
         $this->extract_attributes($markup);
     } else {
         throw new LiquidException("Syntax Error in 'table_row loop' - Valid syntax: table_row [item] in [collection] cols=3");
     }
 }
 /**
  * Constructor
  *
  * @param string $markup
  * @param array $tokens
  * @param LiquidFileSystem $fileSystem
  * @return ForLiquidTag
  */
 public function __construct($markup, &$tokens, &$fileSystem)
 {
     parent::__construct($markup, $tokens, $fileSystem);
     $syntaxRegexp = new LiquidRegexp('/(\\w+)\\s+in\\s+(' . LIQUID_ALLOWED_VARIABLE_CHARS . '+)/');
     if ($syntaxRegexp->match($markup)) {
         $this->_variableName = $syntaxRegexp->matches[1];
         $this->_collectionName = $syntaxRegexp->matches[2];
         $this->_name = $syntaxRegexp->matches[1] . '-' . $syntaxRegexp->matches[2];
         $this->extractAttributes($markup);
     } else {
         throw new LiquidException("Syntax Error in 'for loop' - Valid syntax: for [item] in [collection]");
     }
 }
 /**
  * Constructor
  *
  * @param string $markup
  * @param array $tokens
  * @param LiquidFileSystem $fileSystem
  * @return ForLiquidTag
  */
 public function __construct($markup, &$tokens, &$fileSystem)
 {
     parent::__construct($markup, $tokens, $fileSystem);
     $syntax = new LiquidRegexp('/(' . LIQUID_ALLOWED_VARIABLE_CHARS . '+)\\s+by\\s+(\\w+)/');
     if ($syntax->match($markup)) {
         $this->_collectionName = $syntax->matches[1];
         $this->_numberItems = $syntax->matches[2];
         $this->_currentPage = is_numeric($_GET['page']) ? $_GET['page'] : 1;
         $this->_currentOffset = ($this->_currentPage - 1) * $this->_numberItems;
         $this->extractAttributes($markup);
     } else {
         throw new LiquidException("Syntax Error - Valid syntax: paginate [collection] by [items]");
     }
 }
 /**
  * Constructor
  *
  * @param string $markup
  * @param array $tokens
  * @param LiquidFileSystem $file_system
  * @return ForLiquidTag
  */
 public function __construct($markup, &$tokens, &$file_system)
 {
     parent::__construct($markup, $tokens, $file_system);
     $syntax_regexp = new LiquidRegexp('/(\\w+)\\s+in\\s+(' . LIQUID_ALLOWED_VARIABLE_CHARS . '+)/');
     if ($syntax_regexp->match($markup)) {
         $this->_variableName = $syntax_regexp->matches[1];
         $this->_collectionName = $syntax_regexp->matches[2];
         $this->_name = $syntax_regexp->matches[1] . '-' . $syntax_regexp->matches[2];
         $this->extractAttributes($markup);
     } else {
         $syntax_regexp = new LiquidRegexp('/(\\w+)\\s+in\\s+\\((\\d|' . LIQUID_ALLOWED_VARIABLE_CHARS . '+)\\s*..\\s*(\\d|' . LIQUID_ALLOWED_VARIABLE_CHARS . '+)\\)/');
         if ($syntax_regexp->match($markup)) {
             $this->_type = 'digit';
             $this->_variableName = $syntax_regexp->matches[1];
             $this->_start = $syntax_regexp->matches[2];
             $this->_collectionName = $syntax_regexp->matches[3];
             $this->_name = $syntax_regexp->matches[1] . '-digit';
             $this->extractAttributes($markup);
         } else {
             throw new LiquidException("Syntax Error in 'for loop' - Valid syntax: for [item] in [collection] OR for [int] in ([start]..[end])");
         }
     }
 }
Exemple #7
0
 public function __construct($meta = 0)
 {
     parent::__construct(LAVA, $meta, "Lava");
     $this->hardness = 0;
 }
Exemple #8
0
 public function __construct($meta = 0)
 {
     parent::__construct(WATER, $meta, "Water");
     $this->hardness = 500;
 }
 public function __construct($meta = 0)
 {
     LiquidBlock::__construct(STILL_WATER, $meta, "Still Water");
     $this->hardness = 500;
 }
Exemple #10
0
 public function __construct($meta = 0)
 {
     parent::__construct(STILL_LAVA, $meta, "Still Lava");
     $this->hardness = 500;
 }