ContentProcessor->processVariables($matches['forStart'])); $end = intval($this->ContentProcessor->processVariables($matches['forEnd'])); $html = ''; $TemplateProcessor = $this->initTemplateProcessor(); // Save the index before any loop - the index will be overwritten when iterating over filter, tags and files and must be restored after the loop. $runtimeShelf = $this->Runtime->shelve(); // The loop. for ($i = $start; $i <= $end; $i++) { // Set index variable. The index can be used as @{:i}. $this->Runtime->set(Fields::LOOP_INDEX, $i); // Parse snippet. Debug::log($i, 'Processing snippet in loop for index'); $html .= $TemplateProcessor->process($matches['forSnippet'], $directory, $collectSnippetDefinitions); } // Restore index. $this->Runtime->unshelve($runtimeShelf); return $html; } /** * The pattern that is used to match for loops. * * @return string the for loop pattern */ public static function syntaxPattern(): string { $statementOpen = preg_quote(Delimiters::STATEMENT_OPEN); $statementClose = preg_quote(Delimiters::STATEMENT_CLOSE); return $statementOpen . '\s*' . Delimiters::OUTER_STATEMENT_MARKER . '\s*' . 'for\s+(?P' . PatternAssembly::variable() . '|' . PatternAssembly::NUMBER . ')\s+to\s+(?P' . PatternAssembly::variable() . '|' . PatternAssembly::NUMBER . ')\s*' . $statementClose . '(?P.*?)' . $statementOpen . Delimiters::OUTER_STATEMENT_MARKER . '\s*end' . '\s*' . $statementClose; } } __halt_compiler();----SIGNATURE:----wDcSX16G1/kO9vWVQK1RheOmhMwelFXmzr18fpLT8osyhXlJZFFes/QmC5DdV20mtFnnnJh5CZD8hSCUkjlbfXvaL1ZBk0u9+qctmKL6v7rzrYKoAu5pbUfz+5myBYRvzs3YMpse+eYyBf/GhwjcMKFXyC512BsDx2RuygobQfnvkA5M35NGsZtdPY2KFsXa01TKnqVuuI3Mgj9U/wuEEGmNJGsHgaAoA1opS9qcDX0w6Lr05sN/M/vmHl77dRjqp5QKMReozLJw8j70ZmKHkIB7l0x7h+xy6F4jimktcvqXtLcOnBXs8VMcQCbyOMCtHZx80GboNZhy3AH/dXLId0n7xe8Hv1dr3kfZLTF5J50LxUgUoK/5qPxVgPGPGfkbHaWUz7Dq39rpnA6s3q/5JEHBTS4wuZ7td3GPfKhVb76snIi+0HvUx/6txiVJX7yO1Wrthdvz85XwClFodDby5BJ4ZVFgaj1amM4lMSawaSwlTBOMATohWS+iPCOvx2vUgyd5bHn2cez4mxY+1LyX+w3r49Nuz9hVbvHTtrIS1kvmmCihuh++ZsnM8xAWktZw1l7jQ+Se9qSO7tgOOh/AfCSzdFIVS7cmCM6PY8WZ6IbEod60kW1eHoUeDwR6W0k+Jm84CGQwpCMeEgQUl4fMOafF3SGzRdlJZWuz22VMj90=----ATTACHMENT:----ODQ5OTYyNDgyNjQwMTEyOCA5MDk2ODI5MzIxMDExMjgxIDMwNzk1NTY2MjgyMTg3NDM=