webCOMAND

request::set_post()

Set the value that will be returned by post().

Prototype

string set_post(string $key, string $value = NULL)

Parameters

  • key - Name of the parameter to set.
  • value - Optional parameter with the value to set.  If not provided or NULL, the parameter will be unset.

Return

If the POST parameter was set (always TRUE).

Example

// retrieve the value of the "search" GET parameter, then change it
$request = new \io_comand_web\request();
$original_value = $request->post('search');
$request->set_post('search', 'new');
$new_value = $request->post('search');