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

        $name = array_shift($attr);
        $equal = array_shift($attr);

        if ('=' !== $equal) {
            array_unshift($attr, $equal);
        }

        if (!$attr) {
            $value = 'null';
        } else {
            $value = $this->parseExpression(implode(' ', $attr));

            if ('' === $value) {
                $value = 'null';
            }
        }

        $theme['content'] = $this->withPhpTag("\${$name} = ".$value.';');
    }
public function letJsCompiler(array &$theme): void
    {
        $this->checkNode($theme, true);
        $attr = $this->getNodeAttribute($theme);

        $name = array_shift($attr);
        $equal = array_shift($attr);

        if ('=' !== $equal) {
            array_unshift($attr, $equal);
        }

        if (!$attr) {
            $value = 'null';
        } else {
            $value = $this->parseExpression(implode(' ', $attr));

            if ('' === $value) {
                $value = 'null';
            }
        }

        $theme['content'] = $this->withPhpTag("\${$name} = ".$value.';');
    }
let 编译器.

@param array $theme