src/Leevel/Validate/Validator.php
public function getFieldValue(string $rule)
    {
        if (false === strpos($rule, '.')) {
            if (isset($this->datas[$rule])) {
                return $this->datas[$rule];
            }
        } else {
            $parts = explode('.', $rule);
            $datas = $this->datas;

            foreach ($parts as $part) {
                if (!isset($datas[$part])) {
                    return;
                }

                $datas = $datas[$part];
            }

            return $datas;
        }
    }
public function getFieldValue(string $rule)
    {
        if (false === strpos($rule, '.')) {
            if (isset($this->datas[$rule])) {
                return $this->datas[$rule];
            }
        } else {
            $parts = explode('.', $rule);
            $datas = $this->datas;

            foreach ($parts as $part) {
                if (!isset($datas[$part])) {
                    return;
                }

                $datas = $datas[$part];
            }

            return $datas;
        }
    }
获取字段的值

@param string $rule

@return mixed