/** * Constructor * * @param string $markup * @param Array $tokens * @param FileSystem $fileSystem * * @throws \Liquid\LiquidException * @return \Liquid\Tag\TagBlock */ public function __construct($markup, array &$tokens, FileSystem $fileSystem = null) { $syntaxRegexp = new Regexp('/(\\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 FileSystem $fileSystem * * @throws \Liquid\LiquidException * */ public function __construct($markup, array &$tokens, FileSystem $fileSystem = null) { parent::__construct($markup, $tokens, $fileSystem); $syntax = new Regexp('/(' . Liquid::get('ALLOWED_VARIABLE_CHARS') . '+)\\s+by\\s+(\\w+)/'); if ($syntax->match($markup)) { $this->collectionName = $syntax->matches[1]; $this->numberItems = $syntax->matches[2]; $this->extractAttributes($markup); } else { throw new LiquidException("Syntax Error - Valid syntax: paginate [collection] by [items]"); } }
/** * Constructor * * @param string $markup * @param array $tokens * @param FileSystem $fileSystem * * @throws \Liquid\LiquidException */ public function __construct($markup, array &$tokens, FileSystem $fileSystem = null) { parent::__construct($markup, $tokens, $fileSystem); $syntax = new Regexp("/(\\w+)\\s+in\\s+(" . Liquid::get('ALLOWED_VARIABLE_CHARS') . "+)/"); if ($syntax->match($markup)) { $this->variableName = $syntax->matches[1]; $this->collectionName = $syntax->matches[2]; $this->extractAttributes($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 FileSystem $fileSystem * * @throws \Liquid\LiquidException */ public function __construct($markup, array &$tokens, FileSystem $fileSystem = null) { parent::__construct($markup, $tokens, $fileSystem); $syntaxRegexp = new Regexp('/(\\w+)\\s+in\\s+(' . Liquid::get('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 FileSystem $fileSystem * * @throws \Liquid\LiquidException */ public function __construct($markup, array &$tokens, FileSystem $fileSystem = null) { parent::__construct($markup, $tokens, $fileSystem); }