lithium\console\Request::args PHP Method

args() public method

Get the value of a command line argument at a given key
public args ( integer $key ) : mixed
$key integer
return mixed returns null if key does not exist or the value of the key in the args array
    public function args($key = 0)
    {
        if (!empty($this->args[$key])) {
            return $this->args[$key];
        }
        return null;
    }

Usage Example

Example #1
0
 public function testArgs()
 {
     $request = new Request();
     $request->params = array('command' => 'one', 'action' => 'two', 'args' => array('three', 'four', 'five'));
     $this->assertEqual('five', $request->args(2));
 }