如果$name为空则获取COOKIE数组,不为空则获取单个COOKIE。在Controller中使用
| 参数 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| $name | String | 否 | $_COOKIE值,如果为空返回整个$_COOKIE数组 |
public function run() {
setcookie('username', 'sssssssssss', time()+35450);
echo $this->controller->get_cookie('username');
$this->view->display(); //模板显示
}
如果$name为空则获取ENV数组,不为空则获取单个ENV。在Controller中使用
| 参数 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| $name | String | 否 | $_ENV值,如果为空返回整个$_ENV数组 |
public function run() {
$env = $this->controller->get_env();
$this->view->display(); //模板显示
}
如果$name为空则获取GET数组,不为空则获取单个GET。获取POST和GET数据,尽量走get_gp函数,这个函数没有字符串过滤,安全性不高。在Controller中使用
| 参数 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| $name | String | 否 | $_GET值,如果为空返回整个$_GET数组 |
public function run() {
$this->controller->get_get('username');//获取$_GET['username']
$this->view->display(); //模板显示
}
Request-获取IP信息。在Controller中使用
public function run() {
echo $this->controller->get_ip();
$this->view->display(); //模板显示
}
Request-获取PHP_SELF信息。在Controller中使用
public function run() {
$this->controller->get_php_self();
$this->view->display(); //模板显示
}
如果$name为空则获取post数组,不为空则获取单个POST。获取POST和GET数据,尽量走get_gp函数,这个函数没有字符串过滤,安全性不高。在Controller中使用
| 参数 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| $name | String | 否 | $_POST值,如果为空返回整个$_POST数组 |
public function run() {
$this->controller->get_post('username');//获取$_POST['username']
$this->view->display(); //模板显示
}
Request-获取REQUEST TIME信息。在Controller中使用
public function run() {
$this->controller->get_request_time();
$this->view->display(); //模板显示
}
Request-获取SERVICENAME信息。在Controller中使用
public function run() {
$this->controller->get_service_name();
$this->view->display(); //模板显示
}
如果$name为空则获取SERVICE数组,不为空则获取单个SERVICE。在Controller中使用
| 参数 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| $name | String | 否 | $_SERVICE值,如果为空返回整个$_SERVICE数组 |
public function run() {
$this->controller->get_service();
$this->view->display(); //模板显示
}
如果$name为空则获取SESSION数组,不为空则获取单个SESSION。在Controller中使用
| 参数 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| $name | String | 否 | $_SESSION值,如果为空返回整个$_SESSION数组 |
public function run() {
$username = $this->controller->get_session('username');
$this->view->display(); //模板显示
}
Request-获取URI信息。在Controller中使用
| 参数 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| $name | String | 否 | $_SESSION值,如果为空返回整个$_SESSION数组 |
public function run() {
$this->controller->get_uri();
$this->view->display(); //模板显示
}
Request-获取useragent信息。在Controller中使用
public function run() {
$this->controller->get_useragent();
$this->view->display(); //模板显示
}
Request-判断是否是ajax提交方式。在Controller中使用
public function run() {
$this->controller->is_ajax();
$this->view->display(); //模板显示
}
Request-判断是否是GET提交方式。在Controller中使用
public function run() {
$this->controller->is_get();
$this->view->display(); //模板显示
}
Request-判断是否是POST提交方式。在Controller中使用
public function run() {
$this->controller->is_post();
$this->view->display(); //模板显示
}