欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

PHP中TP5Request請求對象的示例分析-創(chuàng)新互聯

這篇文章主要介紹PHP中TP5 Request請求對象的示例分析,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!

創(chuàng)新互聯公司主要從事網站設計制作、成都網站設計、網頁設計、企業(yè)做網站、公司建網站等業(yè)務。立足成都服務古塔,10年網站建設經驗,價格優(yōu)惠、服務專業(yè),歡迎來電咨詢建站服務:028-86922220

PHP 中TP5 Request 請求對象

public/index.php


<?php 
 
// [ 應用入口文件 ] 
// 定義應用目錄 
define('APP_PATH', __DIR__ . '/../app/'); 
 
// 定義配置文件目錄和應用目錄同級 
define('CONF_PATH', __DIR__.'/../config/'); 
 
// 加載框架引導文件 
require __DIR__ . '/../thinkphp/start.php';

 app\index\controller\Index.php


<?php 
namespace app\index\controller; 
use think\Request; 
class Index 
{ 
  public function index(Request $request) 
  { 
    # 獲取瀏覽器輸入框的值 
    dump($request->domain()); 
    dump($request->pathinfo()); 
    dump($request->path()); 
     
    # 請求類型 
    dump($request->method()); 
    dump($request->isGet()); 
    dump($request->isPost()); 
    dump($request->isAjax()); 
     
    # 請求的參數 
    dump($request->get()); 
    dump($request->param()); 
    dump($request->post()); 
    //session('name', 'onestopweb'); 
    //cookie('email', 'onestopweb@163.com'); 
    //session(null); 
    //cookie('email',null); 
    dump($request->session()); 
    dump($request->cookie()); 
     
    dump($request->param('type')); 
    dump($request->cookie('email')); 
     
    # 獲取模塊 控制器 操作 
    dump($request->module()); 
    dump($request->controller()); 
    dump($request->action()); 
     
    # 獲取URL 
    dump($request->url()); 
    dump($request->baseUrl()); 
  } 
}

 地址欄輸入的鏈接:http://192.168.0.180:55/index/index/index.html?name=chaoyi&type=blog


string(23) "http://192.168.0.180:55" 
string(22) "index/index/index.html" 
string(17) "index/index/index" 
string(3) "GET" 
bool(true) 
bool(false) 
bool(false) 
array(2) { 
 ["name"] => string(6) "chaoyi" 
 ["type"] => string(4) "blog" 
} 
array(2) { 
 ["name"] => string(6) "chaoyi" 
 ["type"] => string(4) "blog" 
} 
array(0) { 
} 
array(1) { 
 ["name"] => string(10) "onestopweb" 
} 
array(3) { 
 ["username"] => string(6) "chaoyi" 
 ["PHPSESSID"] => string(26) "nugcsr2j9krr2lhk8bntggl412" 
 ["email"] => string(18) "onestopweb@163.com" 
} 
string(4) "blog" 
string(18) "onestopweb@163.com" 
string(5) "index" 
string(5) "Index" 
string(5) "index" 
string(45) "/index/index/index.html?name=chaoyi&type=blog" 
string(23) "/index/index/index.html"

以上是“PHP中TP5 Request請求對象的示例分析”這篇文章的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注創(chuàng)新互聯行業(yè)資訊頻道!

文章名稱:PHP中TP5Request請求對象的示例分析-創(chuàng)新互聯
文章出自:http://www.chinadenli.net/article46/pdshg.html

成都網站建設公司_創(chuàng)新互聯,為您提供動態(tài)網站自適應網站軟件開發(fā)關鍵詞優(yōu)化定制網站搜索引擎優(yōu)化

廣告

聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯

成都seo排名網站優(yōu)化