File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
user_guide_src/source/cli Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -10,31 +10,36 @@ but adds some accessor methods for convenience.
10
10
Additional Accessors
11
11
====================
12
12
13
- **getSegments() **
13
+ getSegments()
14
+ -------------
14
15
15
16
Returns an array of the command line arguments deemed to be part of a path:
16
17
17
18
.. literalinclude :: cli_request/001.php
18
19
19
- **getPath() **
20
+ getPath()
21
+ ---------
20
22
21
23
Returns the reconstructed path as a string:
22
24
23
25
.. literalinclude :: cli_request/002.php
24
26
25
- **getOptions() **
27
+ getOptions()
28
+ ------------
26
29
27
30
Returns an array of the command line arguments deemed to be options:
28
31
29
32
.. literalinclude :: cli_request/003.php
30
33
31
- **getOption($which) **
34
+ getOption($which)
35
+ -----------------
32
36
33
37
Returns the value of a specific command line argument deemed to be an option:
34
38
35
39
.. literalinclude :: cli_request/004.php
36
40
37
- **getOptionString() **
41
+ getOptionString()
42
+ -----------------
38
43
39
44
Returns the reconstructed command line string for the options:
40
45
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
// command line: php index.php users 21 profile --foo bar
4
- echo $ request ->getOption ('foo ' ); // bar
4
+ echo $ request ->getOption ('foo ' ); // bar
5
5
echo $ request ->getOption ('notthere ' ); // null
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
// php index.php user 21 --foo bar -f
4
- echo $ request ->getOptionString (); // -foo bar -f
4
+ echo $ request ->getOptionString (); // -foo bar -f
5
5
echo $ request ->getOptionString (true ); // --foo bar -f
You can’t perform that action at this time.
0 commit comments