예제 #1
0
 /**
  * Constructor
  *
  * @param string $markup
  * @param array $tokens
  * @param LiquidFileSystem $file_system
  * @return IncludeLiquidTag
  */
 function IncludeLiquidTag($markup, &$tokens, &$file_system)
 {
     $regex = new LiquidRegexp('/("[^"]+"|\'[^\']+\')(\\s+(with|for)\\s+(' . LIQUID_QUOTED_FRAGMENT . '+))?/');
     if ($regex->match($markup)) {
         $this->template_name = substr($regex->matches[1], 1, strlen($regex->matches[1]) - 2);
         if (isset($regex->matches[1])) {
             $this->collection = $regex->matches[3] == "for";
             $this->variable = $regex->matches[4];
         }
         $this->extract_attributes($markup);
     } else {
         trigger_error("Error in tag 'include' - Valid syntax: include '[template]' (with|for) [object|collection]", E_USER_ERROR);
     }
     parent::LiquidTag($markup, $tokens, $file_system);
 }