- WIP on caching interface - Work done on easing template rendering for the controller
21 lines
464 B
PHP
21 lines
464 B
PHP
<?php
|
|
|
|
namespace Picea\ControlStructure;
|
|
|
|
class ForToken implements ControlStructure {
|
|
|
|
public string $token = "for";
|
|
|
|
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) {
|
|
$uid = "$".uniqid("for_");
|
|
|
|
$context->iterationStack[] = [
|
|
'or' => false,
|
|
'uid' => $uid,
|
|
'token' => 'endfor',
|
|
];
|
|
|
|
return "<?php for ($arguments): {$uid} = 1; ?>";
|
|
}
|
|
}
|