Skip to content

Requests

M. Drew LaMar edited this page Jun 17, 2020 · 1 revision

HubZero's documentation

Definition:

/**
 * Get var
 * 
 * @param   string   $key      Request key
 * @param   mixed    $default  Default value
 * @param   string   $hash     Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
 * @param   string   $type     Return type for the variable. [!] Deprecated. Joomla legacy support.
 * @param   string   $mask     Filter mask for the variable. [!] Deprecated. Joomla legacy support.
 * @return  integer  Request variable
 */
public function getVar($key, $default = null, $hash = 'input', $type = 'none', $mask = 0)

An array

Server (permalink)

$comment = Request::getVar('comment', array(), 'post', 'none', 2);

Client (permalink)

<input type="hidden" name="comment[id]" value="..." />
<input type="hidden" name="comment[parent]" value="..." />

A file

Server (permalink)

$upload = Request::getVar('comment_file', '', 'files', 'array');

Client (permalink)

<input type="file" name="comment_file" ... />

Clone this wiki locally