请求URLs

  • url:返回 /admin/index.php/product?id=100, 此URL不包括host info部分。
  • absoluteUrl:返回 http://example.com/admin/index.php/product?id=100, 包含host infode的整个URL。
  • hostInfo:返回 http://example.com, 只有host info部分。
  • pathInfo:返回 /product, 这个是入口脚本之后,问号之前(查询字符串)的部分。
  • queryString:返回 id=100,问号之后的部分。
  • baseUrl:返回 /admin, host info之后, 入口脚本之前的部分。
  • scriptUrl:返回 /admin/index.php, 没有path info和查询字符串部分。
  • serverName:返回 example.com, URL中的host name。
  • serverPort:返回 80, 这是web服务中使用的端口。
  •        

  • $headers = Yii::$app->request->headers;

    // 返回 Accept header 值
    $accept = $headers->get('Accept');

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值