\QuickApps\ConsoleWebConsoleInput

Wrapper for Cake's ConsoleInput.

Allows to simulate CLI reads over POST data. It uses incoming POST array as a stack. Check the read() method for further information.

Summary

Methods
Properties
Constants
__construct()
read()
No public properties found
No constants found
No protected methods found
$_postData
N/A
No private methods found
No private properties found
N/A

Properties

$_postData

$_postData : array

POST data incoming from current request. Indexed by name.

Example:

[
    'input1' => 'value1',
    'input2' => 'value2',
    ...
    'inputn' => 'valuen',
]

Type

array

Methods

__construct()

__construct(string $handle)

Constructor

Parameters

string $handle

The location of the stream to use as input.

read()

read() : mixed

Read a value from POST data.

It reads the first input and removes that value from the stack, so consecutive readings are supported as follow:

Incoming POST data array

[
    'input1' => 'value1',
    'input2' => 'value2',
    'input3' => 'value3',
]

Reading from POST:

$this->read(); // returns "value1"
$this->read(); // returns "value2"
$this->read(); // returns "value3"
$this->read(); // returns false

Returns

mixed —

The value from POST data