widget/WidgetHelper.php
public static function getValue(string $varType, array $input, string $key)
    {
        switch ($varType) {
            case 'bool':
            case 'boolean':
                return Request::input($input, $key . ':b', false);
            case 'int':
            case 'integer':
                $val = Request::input($input, $key . ':s', '');
                if (preg_match('@[+-]?\d*\.\d+@', $val)) {
                    return Request::input($input, $key . ':f', 0);
                } else {
                    return Request::input($input, $key . ':i', 0);
                }
            case 'double':
            case 'float':
                return Request::input($input, $key . ':f', 0);
            case 'string':
                return Request::input($input, $key . ':s', '');
            case 'array':
                return Request::input($input, $key . ':a', []);
            default :
                return Request::input($input, $key, '');
        }
        return null;
    }
public static function getValue(string $varType, array $input, string $key)
    {
        switch ($varType) {
            case 'bool':
            case 'boolean':
                return Request::input($input, $key . ':b', false);
            case 'int':
            case 'integer':
                $val = Request::input($input, $key . ':s', '');
                if (preg_match('@[+-]?\d*\.\d+@', $val)) {
                    return Request::input($input, $key . ':f', 0);
                } else {
                    return Request::input($input, $key . ':i', 0);
                }
            case 'double':
            case 'float':
                return Request::input($input, $key . ':f', 0);
            case 'string':
                return Request::input($input, $key . ':s', '');
            case 'array':
                return Request::input($input, $key . ':a', []);
            default :
                return Request::input($input, $key, '');
        }
        return null;
    }
根据类型 获取对应的值
@param string $varType
@param array $input
@param string $key
@return null