webCOMAND

ajax::get()

The get method provides access to response data values previously set with the set method.  If no data value is defined, NULL is returned.

The more common approach is to reference the data value as a property, like $value = $ajax->property;.

Prototype

mixed get(string $key)

Parameters

  • $key - Name of the parameter to retrieve.  If NULL or no key is provided, an associative array of all parameters will be returned.

Return

Returns the value of the parameter identified by the key, or NULL if not value is defined.

Example

// retrieve the value of the "search"
$ajax = new \io_comand_web\ajax();
$ajax->set('search', 'test');
$search = $ajax->get('search');
if($search === NULL) {
    // no search specified
}