/** * Breaks the request down into an object. * @param string $raw Raw request. * @return SimpleFormEncoding Parsed data. * @access private */ function _parseRequest($raw) { $request = new SimpleFormEncoding(); foreach (split("&", $raw) as $pair) { if (preg_match('/(.*?)=(.*)/', $pair, $matches)) { $request->add($matches[1], urldecode($matches[2])); } elseif ($pair) { $request->add($pair, ''); } } return $request; }
/** * Creates the encoding for the current values in the * form. * @return SimpleFormEncoding Request to submit. * @access private */ function _getEncoding() { $encoding = new SimpleFormEncoding(); for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { $encoding->add($this->_widgets[$i]->getName(), $this->_widgets[$i]->getValue()); } return $encoding; }