- WIP on caching interface - Work done on easing template rendering for the controller
21 lines
490 B
PHP
21 lines
490 B
PHP
<?php
|
|
|
|
namespace Picea\ControlStructure;
|
|
|
|
class EndforToken implements ControlStructure {
|
|
|
|
public string $token = "endfor";
|
|
|
|
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) {
|
|
if ( end($context->iterationStack)['or'] === false ) {
|
|
$output = "<?php endfor; ?>";
|
|
}
|
|
else {
|
|
$output = "<?php endif; ?>";
|
|
}
|
|
|
|
array_pop($context->iterationStack);
|
|
return $output;
|
|
}
|
|
}
|