Updating docs for serializeForm.

Making url for form js more flexible.
This commit is contained in:
mark_story 2009-07-24 22:47:08 -04:00
parent 36722c0ef2
commit e8b39fb9a5

View file

@ -257,13 +257,18 @@ class JsHelper extends AppHelper {
$out = $this->Form->submit($caption, $htmlOptions); $out = $this->Form->submit($caption, $htmlOptions);
$this->get('#' . $htmlOptions['id']); $this->get('#' . $htmlOptions['id']);
$options['data'] = $this->serializeForm('#' . $htmlOptions); $options['data'] = $this->serializeForm(false);
$requestString = ''; $requestString = $url = '';
if (isset($options['confirm'])) { if (isset($options['confirm'])) {
$requestString = $this->confirmReturn($options['confirm']); $requestString = $this->confirmReturn($options['confirm']);
unset($options['confirm']); unset($options['confirm']);
} }
$requestString .= $this->request('', $options); if (isset($options['url'])) {
$url = $options['url'];
unset($options['url']);
}
$requestString .= $this->request($url, $options);
if (!empty($requestString)) { if (!empty($requestString)) {
$event = $this->event('click', $requestString, $options); $event = $this->event('click', $requestString, $options);
} }
@ -790,9 +795,13 @@ class JsBaseEngineHelper extends AppHelper {
trigger_error(sprintf(__('%s does not have slider() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have slider() implemented', true), get_class($this)), E_USER_WARNING);
} }
/** /**
* serializeForm * Serialize the form attached to $selector.
* * Pass `true` for $isForm if the current selection is a form element.
* @return string Completed form serialization script * Converts the form or the form element attached to the current selection into a string/json object
* (depending on the library implementation) for use with XHR operations.
*
* @param boolean $isForm is the current selection a form?
* @return string completed form serialization script
**/ **/
function serializeForm() { function serializeForm() {
trigger_error( trigger_error(