小智 5
这两种方法的一个重要部分,
$request->input() ::可以使用任何 HTTP 动词(例如 GET,POST,..)
$request->query() ::只能检索从查询字符串传递的数据( GET 方法)
如果您仅使用查询字符串来传递数据,则两种方法都会得到相同的结果,但如果您使用任何其他 HTTP 方法(可能带有查询字符串值),您会发现差异。
在本机 PHP 编码中。
$request->input() is the equivalent of $_REQUEST //this is either querystring or form-data submission.
$request->query() is just a straight forward $_GET //this is querystring
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
879 次 |
| 最近记录: |