src/Leevel/View/Compiler.php
public function endtagCodeCompiler(array &$theme): void
    {
        $theme['content'] = substr(
            $theme['source'],
            strpos($theme['source'], '/'),
            strripos($theme['source'], '}') - 1
        );

        $theme['content'] = call_user_func(
            function ($content) {
                $content = ltrim(trim($content), '/');

                switch ($content) {
                    case 'list':
                        $content = $this->withPhpTag('endforeach; endif;');

                        break;
                    case 'for':
                        $content = $this->withPhpTag('endfor;');

                        break;
                    case 'while':
                        $content = $this->withPhpTag('endwhile;');

                        break;
                    case 'if':
                        $content = $this->withPhpTag('endif;');

                        break;
                    case 'script':
                        $content = '</script>';

                        break;
                    case 'style':
                        $content = '</style>';

                        break;
                }

                return $content;
            }, $theme['content']
        );

        $theme['content'] = $this->encodeContent($theme['content']);
    }
public function endtagCodeCompiler(array &$theme): void
    {
        $theme['content'] = substr(
            $theme['source'],
            strpos($theme['source'], '/'),
            strripos($theme['source'], '}') - 1
        );

        $theme['content'] = call_user_func(
            function ($content) {
                $content = ltrim(trim($content), '/');

                switch ($content) {
                    case 'list':
                        $content = $this->withPhpTag('endforeach; endif;');

                        break;
                    case 'for':
                        $content = $this->withPhpTag('endfor;');

                        break;
                    case 'while':
                        $content = $this->withPhpTag('endwhile;');

                        break;
                    case 'if':
                        $content = $this->withPhpTag('endif;');

                        break;
                    case 'script':
                        $content = '</script>';

                        break;
                    case 'style':
                        $content = '</style>';

                        break;
                }

                return $content;
            }, $theme['content']
        );

        $theme['content'] = $this->encodeContent($theme['content']);
    }
endtag.

@param array $theme