You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.rst
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,10 +18,12 @@ Run the following to install this library:
18
18
Request
19
19
-------
20
20
21
-
The Request object is responsible for managing the input state both in the `HTTP` and `CLI` modes.
21
+
The :code:`Request` object is responsible for managing the input state both in the `HTTP` and `CLI` modes.
22
22
It provides an abstraction layer for getting input data like: a current request and the request's method.
23
23
24
-
**Let consider an example for the HTTP mode:**
24
+
------------
25
+
HTTP example
26
+
------------
25
27
26
28
.. code-block:: php
27
29
@@ -37,11 +39,13 @@ It provides an abstraction layer for getting input data like: a current request
37
39
echo $request->getRequest(); // prints the current request like: "/", "/users", "/documents/view", etc
38
40
echo $request->getMethod(); // prints the current method like: "GET", "POST", "DELETE", etc
39
41
40
-
PS: The **RequestHttpParams** ignores any http `GET` parameters and returns only the request's path.
41
-
E.g **/users/?param=1** would be **/users**, also it removes sub directory path - **sub_directory/users/** would be **/users**, it very
42
+
PS: The :code:`RequestHttpParams` ignores any http `GET` parameters and returns only the request's path.
43
+
E.g :code:`/users/?param=1` would be :code:`/users`, also it removes sub directory path - :code:`sub_directory/users/` would be just :code:`/users`, it very
42
44
helpful for the routing handling.
43
45
44
-
**Let consider an example for the CLI mode:**
46
+
-----------
47
+
CLI example
48
+
-----------
45
49
46
50
.. code-block:: php
47
51
@@ -59,7 +63,11 @@ helpful for the routing handling.
59
63
60
64
// example of calling: php index.php user import 1
61
65
62
-
**We even can create a universal way for handling requests, and don't care if it CLI or HTTP mode**
66
+
-----------------
67
+
Universal example
68
+
-----------------
69
+
70
+
In this case we don't really care about the current mode, we just work with the abstraction.
0 commit comments