1: <?php
2:
3: namespace Deimos\Flow\Extension\TForeach;
4:
5: use Deimos\Flow\FlowFunction;
6:
7: class TElseForeach extends FlowFunction
8: {
9:
10: public static $elseForeach = [];
11:
12: public function view()
13: {
14: self::$elseForeach[TForeach::$level] = true;
15:
16: $init = '';
17:
18: if (!empty(TForeach::$name[TForeach::$level]))
19: {
20: // $init = '$this->foreach->' . TForeach::$name[TForeach::$level] . '->end();';
21:
22: TForeach::$name[TForeach::$level] = null;
23: }
24:
25: return '<?php endforeach; ' . $init . ' else: ?>';
26: }
27:
28: }