File tree Expand file tree Collapse file tree
user_guide_src/source/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,31 +10,36 @@ but adds some accessor methods for convenience.
1010Additional Accessors
1111====================
1212
13- **getSegments() **
13+ getSegments()
14+ -------------
1415
1516Returns an array of the command line arguments deemed to be part of a path:
1617
1718.. literalinclude :: cli_request/001.php
1819
19- **getPath() **
20+ getPath()
21+ ---------
2022
2123Returns the reconstructed path as a string:
2224
2325.. literalinclude :: cli_request/002.php
2426
25- **getOptions() **
27+ getOptions()
28+ ------------
2629
2730Returns an array of the command line arguments deemed to be options:
2831
2932.. literalinclude :: cli_request/003.php
3033
31- **getOption($which) **
34+ getOption($which)
35+ -----------------
3236
3337Returns the value of a specific command line argument deemed to be an option:
3438
3539.. literalinclude :: cli_request/004.php
3640
37- **getOptionString() **
41+ getOptionString()
42+ -----------------
3843
3944Returns the reconstructed command line string for the options:
4045
Original file line number Diff line number Diff line change 11<?php
22
33// command line: php index.php users 21 profile --foo bar
4- echo $ request ->getOption ('foo ' ); // bar
4+ echo $ request ->getOption ('foo ' ); // bar
55echo $ request ->getOption ('notthere ' ); // null
Original file line number Diff line number Diff line change 11<?php
22
33// php index.php user 21 --foo bar -f
4- echo $ request ->getOptionString (); // -foo bar -f
4+ echo $ request ->getOptionString (); // -foo bar -f
55echo $ request ->getOptionString (true ); // --foo bar -f
You can’t perform that action at this time.
0 commit comments