# Xcrud_postdata

Represents xCRUD's form data sent to the server. Accessed through callable methods such as those under the Data Manipulation section.

# get()

Returns value of a field or false if field does not exist.

Parameter Type Default Description
$name string '' POST field name value to return. Returns false if field does not exist.
$postdata->get('email'); // return $_POST['email'] ?? false

# set()

Sets a new value for a field or creates a new field in posted data.

Parameter Type Default Description
$name string '' POST array key to set a new value for or create if it does not exist.
$value string '' Value of $name.
$postdata->set('status', 'on-time'); // $_POST['status'] = 'on-time';

# to_array()

Returns all POST data as an array.

$postdata->to_array();

# del()

Removes field from the posted data. Be careful, this may cause errors in your application.

Parameter Type Default Description
$name string '' Name of the array element to unset.
$postdata->del('status'); // unset($_POST['status'])
Last Updated: 11/1/2021, 10:10:17 PM