- Added a loop index in AbstractLoop control struct.
This commit is contained in:
1 parent
e737e82d7e
commit
ef95576d74
10 files changed
+73
-36
No files matched your search
@@ -5,5 +5,17 @@ namespace Picea\ControlStructure;
|
||||
use DI\Definition\Source\AnnotationBasedAutowiring;
|
||||
|
||||
class ForeachToken extends AbstractLoop {
|
||||
public array $token = [ "foreach", "endforeach" ];
|
||||
public array $token = [ "foreach", "endforeach", "/foreach" ];
|
||||
|
||||
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token, array $options = []) : string
|
||||
{
|
||||
switch($token) {
|
||||
case "foreach":
|
||||
return $this->openLoop($context, $arguments, $token);
|
||||
|
||||
case "endforeach":
|
||||
case "/foreach":
|
||||
return $this->closeLoop($context, $arguments, $token);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user