src/Leevel/View/Compiler.php
public function forNodeCompiler(array &$theme): void
    {
        $this->checkNode($theme);
        $attr = $this->getNodeAttribute($theme);

        null === $attr['step'] && $attr['step'] = '1';
        null === $attr['start'] && $attr['start'] = '0';
        null === $attr['end'] && $attr['end'] = '0';
        null === $attr['var'] && $attr['var'] = 'var';
        $attr['var'] = '$'.$attr['var'];

        if ('-' === $attr['type']) {
            $comparison = ' >= ';
            $minusPlus = ' -= ';
        } else {
            $comparison = ' <= ';
            $minusPlus = ' += ';
        }

        $compiled = [];
        $compiled[] = $this->withPhpTag(
            'for ('.$attr['var'].
            ' = '.$attr['start'].'; '.
            $attr['var'].$comparison.$attr['end'].'; '.
            $attr['var'].$minusPlus.$attr['step'].'):'
        );
        $compiled[] = $this->getNodeBody($theme);
        $compiled[] = $this->withPhpTag('endfor;');

        $theme['content'] = implode('', $compiled);
    }
public function forNodeCompiler(array &$theme): void
    {
        $this->checkNode($theme);
        $attr = $this->getNodeAttribute($theme);

        null === $attr['step'] && $attr['step'] = '1';
        null === $attr['start'] && $attr['start'] = '0';
        null === $attr['end'] && $attr['end'] = '0';
        null === $attr['var'] && $attr['var'] = 'var';
        $attr['var'] = '$'.$attr['var'];

        if ('-' === $attr['type']) {
            $comparison = ' >= ';
            $minusPlus = ' -= ';
        } else {
            $comparison = ' <= ';
            $minusPlus = ' += ';
        }

        $compiled = [];
        $compiled[] = $this->withPhpTag(
            'for ('.$attr['var'].
            ' = '.$attr['start'].'; '.
            $attr['var'].$comparison.$attr['end'].'; '.
            $attr['var'].$minusPlus.$attr['step'].'):'
        );
        $compiled[] = $this->getNodeBody($theme);
        $compiled[] = $this->withPhpTag('endfor;');

        $theme['content'] = implode('', $compiled);
    }
for.

@param array $theme