mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
docs: update sample code for v4.3.0
This commit is contained in:
parent
e2f18bc439
commit
ac477bcf94
@ -2,7 +2,7 @@
|
||||
|
||||
use CodeIgniter\HTTP\IncomingRequest;
|
||||
|
||||
$request = service('request');
|
||||
$request = request();
|
||||
|
||||
// the URI path being requested (i.e., /about)
|
||||
$request->getUri()->getPath();
|
||||
@ -25,4 +25,6 @@ $request->getServer('Host');
|
||||
$request->header('host');
|
||||
$request->header('Content-Type');
|
||||
|
||||
$request->getMethod(); // get, post, put, etc
|
||||
// Checks the HTTP method
|
||||
$request->is('get');
|
||||
$request->is('post');
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use CodeIgniter\HTTP\Response;
|
||||
|
||||
$response = service('response');
|
||||
$response = response();
|
||||
|
||||
$response->setStatusCode(Response::HTTP_OK);
|
||||
$response->setBody($output);
|
||||
|
Loading…
x
Reference in New Issue
Block a user