Skip to content

Commit ac477bc

Browse files
committed
docs: update sample code for v4.3.0
1 parent e2f18bc commit ac477bc

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

user_guide_src/source/concepts/http/001.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use CodeIgniter\HTTP\IncomingRequest;
44

5-
$request = service('request');
5+
$request = request();
66

77
// the URI path being requested (i.e., /about)
88
$request->getUri()->getPath();
@@ -25,4 +25,6 @@
2525
$request->header('host');
2626
$request->header('Content-Type');
2727

28-
$request->getMethod(); // get, post, put, etc
28+
// Checks the HTTP method
29+
$request->is('get');
30+
$request->is('post');

user_guide_src/source/concepts/http/002.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use CodeIgniter\HTTP\Response;
44

5-
$response = service('response');
5+
$response = response();
66

77
$response->setStatusCode(Response::HTTP_OK);
88
$response->setBody($output);

0 commit comments

Comments
 (0)