src/Leevel/View/Compiler.php
protected function parseContentIf(string $content, ?string $type = null): string
    {
        $param = [];

        foreach (explode(' ', $content) as $value) {
            if (strpos($value, '.') > 0) {
                $args = explode('.', $value);
                $param[] = $args[0].($this->arrayHandler($args, true, 1));
            } else {
                $param[] = $value;
            }
        }

        $result = implode(' ', $param);

        if (null === $type) {
            return $result;
        }

        return $type."if ({$result})";
    }
protected function parseContentIf(string $content, ?string $type = null): string
    {
        $param = [];

        foreach (explode(' ', $content) as $value) {
            if (strpos($value, '.') > 0) {
                $args = explode('.', $value);
                $param[] = $args[0].($this->arrayHandler($args, true, 1));
            } else {
                $param[] = $value;
            }
        }

        $result = implode(' ', $param);

        if (null === $type) {
            return $result;
        }

        return $type."if ({$result})";
    }
分析if.

@param string $content
@param string $type

@return string