picea/src/ControlStructure/EndforToken.php
Dave Mc Nicoll bcd49884fc - WIP on RAW token
- WIP on caching interface
- Work done on easing template rendering for the controller
2019-10-04 08:38:11 -04:00

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;
}
}