src/Leevel/View/Compiler.php
protected function checkNode(array $theme, bool $jsNode = false): bool
    {
        $attribute = $theme['children'][0];

        // 验证标签的属性值
        if (true !== $attribute['is_attribute']) {
            throw new InvalidArgumentException('Tag attribute type validation failed.');
        }

        // 验证必要属性
        $tag = true === $jsNode ? $this->jsTag : $this->nodeTag;

        if (!isset($tag[$theme['name']])) {
            throw new InvalidArgumentException(
                sprintf('The tag %s is undefined.', $theme['name'])
            );
        }

        foreach ($tag[$theme['name']]['required'] as $name) {
            $name = strtolower($name);

            if (!isset($attribute['attribute_list'][$name])) {
                throw new InvalidArgumentException(sprintf(
                    'The node %s lacks the required property: %s.', $theme['name'], $name)
                );
            }
        }

        return true;
    }
protected function checkNode(array $theme, bool $jsNode = false): bool
    {
        $attribute = $theme['children'][0];

        // 验证标签的属性值
        if (true !== $attribute['is_attribute']) {
            throw new InvalidArgumentException('Tag attribute type validation failed.');
        }

        // 验证必要属性
        $tag = true === $jsNode ? $this->jsTag : $this->nodeTag;

        if (!isset($tag[$theme['name']])) {
            throw new InvalidArgumentException(
                sprintf('The tag %s is undefined.', $theme['name'])
            );
        }

        foreach ($tag[$theme['name']]['required'] as $name) {
            $name = strtolower($name);

            if (!isset($attribute['attribute_list'][$name])) {
                throw new InvalidArgumentException(sprintf(
                    'The node %s lacks the required property: %s.', $theme['name'], $name)
                );
            }
        }

        return true;
    }
验证节点是否正确.

@param array $theme
@param bool  $jsNode

@return bool