示例#1
0
 /**
  * Constructor
  *
  * @param string $markup
  * @param array $tokens
  * @param LiquidFileSystem $file_system
  * @return TableRowLiquidTag
  */
 function TableRowLiquidTag($markup, &$tokens, &$file_system)
 {
     parent::LiquidTag($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 {
         trigger_error("Syntax Error in 'table_row loop' - Valid syntax: table_row [item] in [collection] cols=3", E_USER_ERROR);
     }
 }
示例#2
0
 /**
  * Constructor
  *
  * @param string $markup
  * @param array $tokens
  * @param LiquidFileSystem $file_system
  * @return ForLiquidTag
  */
 function ForLiquidTag($markup, &$tokens, &$file_system)
 {
     parent::LiquidTag($markup, $tokens, $file_system);
     $syntax_regexp = new LiquidRegexp('/(\\w+)\\s+in\\s+(' . LIQUID_ALLOWED_VARIABLE_CHARS . '+)/');
     if ($syntax_regexp->match($markup, $matches)) {
         $this->variable_name = $syntax_regexp->matches[1];
         $this->collection_name = $syntax_regexp->matches[2];
         $this->name = $syntax_regexp->matches[1] . '-' . $syntax_regexp->matches[2];
         $this->extract_attributes($markup);
     } else {
         trigger_error("Syntax Error in 'for loop' - Valid syntax: for [item] in [collection]", E_USER_ERROR);
     }
 }