PjaxResponseNegotiator
class PjaxResponseNegotiator
Handle the X-Pjax header that AJAX responses may provide, returning the fragment, or, in the case of non-AJAX form submissions, redirecting back to the submitter.
X-Pjax ensures that users won't end up seeing the unstyled form HTML in their browser.
If a JS error prevents the Ajax overriding of form submissions from happening.
It also provides better non-JS operation.
Caution: This API is volatile, and might eventually be replaced by a generic action helper system for controllers.
Methods
No description
No description
Out of the box, the handler "CurrentForm" value, which will return the rendered form.
No description
Set up fragment overriding - will completely replace the incoming fragments.
No description
Details
at line 44
__construct(array $callbacks = array(), HTTPResponse $response = null)
at line 50
getResponse()
at line 58
setResponse($response)
at line 74
HTTPResponse
respond(HTTPRequest $request, array $extraCallbacks = array())
Out of the box, the handler "CurrentForm" value, which will return the rendered form.
Non-Ajax calls will redirect back.
at line 115
setCallback(string $fragment, Callable $callback)
at line 126
$this
setFragmentOverride(array $fragments)
Set up fragment overriding - will completely replace the incoming fragments.