Extracts and sanitizes submitted form data for single control.
public static extractHttpData ( array $data, $htmlName, $type ) : string | string[] | ||
$data | array | |
return | string | string[] |
/** * Returns submitted HTTP data. * @return mixed */ public function getHttpData($type = NULL, $htmlName = NULL) { if ($this->httpData === NULL) { if (!$this->isAnchored()) { throw new Nette\InvalidStateException('Form is not anchored and therefore can not determine whether it was submitted.'); } $data = $this->receiveHttpData(); $this->httpData = (array) $data; $this->submittedBy = is_array($data); } if ($htmlName === NULL) { return $this->httpData; } return Helpers::extractHttpData($this->httpData, $htmlName, $type); }
/** * Loads and process STANDARD http request. NOT uploadify requests! */ public function loadHttpData() { $name = $this->getHtmlName() . '[token]'; $data = $this->getForm()->getHttpData(); // Get queue token for received files // -> js & non-js as well (for js only the token is received) if (!empty($data)) { $token = Forms\Helpers::extractHttpData($data, $name, Forms\Form::DATA_LINE); if ($token) { $this->token = $token; } else { throw new InvalidStateException("Token has not been received! Without token MultipleFileUploader can't identify which files has been received."); } } }