系统类库
[ 查看开发文档 ] [ 类树图: Library ] [ 索引: Library ] [ 所有元素 ] [ 首页 ]

Class: Request

源文件路径: /Library/Request.class.php

Class Overview


系统请求类型


Methods


Inherited Variables

Inherited Methods


Class Details

[line 9]
系统请求类型


[ Top ]


Method Detail

__construct (Constructor)   [line 41]

Request __construct( Application $context)

构造函数(由容器调用)
  • Access: public

Parameters:

Application   $context   —  应用程序对象

[ Top ]

cookie   [line 257]

string|array &cookie( [string|null|array $name = null], [mixed $default = null])

获取Http请求携带的COOKIE信息
  • Access: public

Parameters:

string|null|array   $name   —  需要获取的键名,如果为null获取所有,为数组用于设置
mixed   $default   —  如果key不存在,则返回默认值

[ Top ]

files   [line 284]

array &files( [string $name = null])

获取文件上传信息
  • Access: public

Parameters:

string   $name   —  需要获取的键名,如果为null获取所有

[ Top ]

get   [line 201]

string|array &get( [string $name = null], [mixed $default = null])

获取Http请求的GET参数
  • Access: public

Parameters:

string   $name   —  需要获取的键名,如果为null获取所有
mixed   $default   —  如果key不存在,则返回默认值

[ Top ]

getContext   [line 49]

void getContext( )

获取上下文应用对象
  • Access: public

[ Top ]

getRoute   [line 380]

Route getRoute( )

获取路由对象
  • Return: 路由对象
  • Access: public

[ Top ]

getSapiName   [line 389]

string getSapiName( )

获取系统运行模式
  • Access: public

[ Top ]

header   [line 123]

string|array header( [string|null|array $key = null], [mixed $default = null])

获取Http请求的头部信息(键名为小写)
  • Access: public

Parameters:

string|null|array   $key   —  需要获取的键名,如果为null获取所有,如果为数组则重置请求头部
mixed   $default   —  如果key不存在,则返回默认值

[ Top ]

input   [line 304]

string|array input( [ $name = null], [mixed $default = null], [array $vars = ['post'], string $key)

获取POST/GET输入参数,优先级为: POST> GET
  • Access: public

Parameters:

string   $key   —  获取的键名,默认为null,取所有值
mixed   $default   —  默认值
array   $vars   —  按顺序优先获取的变量,支持post、get、header、cookie和server
   $name   — 

[ Top ]

isMobile   [line 398]

boolean isMobile( )

判断当前是否为移动端登录
  • Access: public

[ Top ]

post   [line 229]

string|array &post( [string|null|array $name = null], [mixed $default = null])

获取Http请求的POST参数
  • Access: public

Parameters:

string|null|array   $name   —  需要获取的键名,如果为null获取所有,为数组用于设置
mixed   $default   —  如果key不存在,则返回默认值

[ Top ]

rawContent   [line 357]

mixed rawContent( )

获取原始的POST包体
  • Return: 返回原始POST数据
  • Access: public
  • Uses: 用于非application/x-www-form-urlencoded格式的Http - POST请求

[ Top ]

server   [line 171]

string|array &server( [string|null|array $name = null], [mixed $default = null])

获取Http请求相关的服务器信息(不区分大小写)
  • Access: public

Parameters:

string|null|array   $name   —  需要获取的键名,如果为null获取所有,为数组用于设置
mixed   $default   —  如果key不存在,则返回默认值

[ Top ]

setRequest   [line 90]

void setRequest( [Request $request = null])

设置外部请求对象
  • Access: public

Parameters:

Request   $request   —  外部响应对象(默认调用传递null)

[ Top ]

setRoute   [line 371]

void setRoute( Route 'get']$route, Route $route)

设置路由对象
  • Access: public

Parameters:

Route   $route   —  路由对象
Route   'get']$route   — 

[ Top ]

__call   [line 64]

void __call( string $name, mixed $args)

动态方法调用
  • Access: public

Parameters:

string   $name   —  方法名称
mixed   $args   — 

参数

目前支持客户端请求方法判断: isGet()、isPost()、isDelete()、isPut()分别用于判断GET、POST、DELETE、PUT请求方法 同时支持特定客户端请求判断: isAjax()、isWechat()、isMobile()分别用于Ajax请求、微信端请求、移动端请求判断


[ Top ]


Powered by Steeze. author email: spring.wind2006@163.com