TYPO3
7.6
|
Public Member Functions | |
__construct ($ajaxId) | |
getAjaxID () | |
setContent ($content) | |
addContent ($key, $content) | |
getContent ($key= '') | |
setContentFormat ($format) | |
setJavascriptCallbackWrap ($javascriptCallbackWrap) | |
setError ($errorMsg= '') | |
isError () | |
render () | |
Protected Member Functions | |
renderAsJavascript () | |
Protected Attributes | |
$ajaxId = null | |
$errorMessage = null | |
$isError = false | |
$content = array() | |
$contentFormat = 'plain' | |
$javascriptCallbackWrap | |
Class to hold all the information about an AJAX call and send the right headers for the request type
Definition at line 25 of file core/Classes/Http/AjaxRequestHandler.php.
__construct | ( | $ajaxId | ) |
Sets the ID for the AJAX call
string | $ajaxId | The AJAX id |
Definition at line 68 of file core/Classes/Http/AjaxRequestHandler.php.
References AjaxRequestHandler\$ajaxId.
addContent | ( | $key, | |
$content | |||
) |
Adds new content
string | $key | The new content key where the content should be added in the content array |
string | $content | The new content to add |
Definition at line 106 of file core/Classes/Http/AjaxRequestHandler.php.
References AjaxRequestHandler\$content, and elseif.
getAjaxID | ( | ) |
Returns the ID for the AJAX call
Definition at line 78 of file core/Classes/Http/AjaxRequestHandler.php.
References AjaxRequestHandler\$ajaxId.
getContent | ( | $key = '' | ) |
Returns the content for the ajax call
Definition at line 127 of file core/Classes/Http/AjaxRequestHandler.php.
References AjaxRequestHandler\$content.
isError | ( | ) |
Checks whether an error occurred during the execution or not
Definition at line 175 of file core/Classes/Http/AjaxRequestHandler.php.
References AjaxRequestHandler\$isError.
Referenced by AjaxRequestHandler\render(), and AjaxRequestHandler\setError().
render | ( | ) |
Renders the AJAX call based on the $contentFormat variable and exits the request
Definition at line 185 of file core/Classes/Http/AjaxRequestHandler.php.
References AjaxRequestHandler\isError(), and AjaxRequestHandler\renderAsJavascript().
|
protected |
Renders the AJAX call as inline JSON inside a script tag. This is useful when an iframe is used as the AJAX transport.
\InvalidArgumentException |
Definition at line 301 of file core/Classes/Http/AjaxRequestHandler.php.
References $response, and GeneralUtility\makeInstance().
Referenced by AjaxRequestHandler\render().
setContent | ( | $content | ) |
Overwrites the existing content with the data supplied
array | $content | The new content |
Definition at line 89 of file core/Classes/Http/AjaxRequestHandler.php.
References AjaxRequestHandler\$content.
setContentFormat | ( | $format | ) |
Sets the content format for the ajax call
string | $format | Can be one of 'plain' (default), 'xml', 'json', 'javascript', 'jsonbody' or 'jsonhead' |
Definition at line 138 of file core/Classes/Http/AjaxRequestHandler.php.
References ArrayUtility\inArray().
setError | ( | $errorMsg = '' | ) |
Sets an error message and the error flag
string | $errorMsg | The error message |
Definition at line 164 of file core/Classes/Http/AjaxRequestHandler.php.
References AjaxRequestHandler\isError().
setJavascriptCallbackWrap | ( | $javascriptCallbackWrap | ) |
Specifies the wrap to be used if contentFormat is "javascript". The wrap used by default stores the results in a variable "response" and adds <script>-Tags around it.
string | $javascriptCallbackWrap | The javascript callback wrap to be used |
Definition at line 153 of file core/Classes/Http/AjaxRequestHandler.php.
References AjaxRequestHandler\$javascriptCallbackWrap.
|
protected |
Definition at line 30 of file core/Classes/Http/AjaxRequestHandler.php.
Referenced by AjaxRequestHandler\__construct(), and AjaxRequestHandler\getAjaxID().
|
protected |
Definition at line 45 of file core/Classes/Http/AjaxRequestHandler.php.
Referenced by AjaxRequestHandler\addContent(), AjaxRequestHandler\getContent(), and AjaxRequestHandler\setContent().
|
protected |
Definition at line 50 of file core/Classes/Http/AjaxRequestHandler.php.
|
protected |
Definition at line 35 of file core/Classes/Http/AjaxRequestHandler.php.
|
protected |
Definition at line 40 of file core/Classes/Http/AjaxRequestHandler.php.
Referenced by AjaxRequestHandler\isError().
|
protected |
Definition at line 55 of file core/Classes/Http/AjaxRequestHandler.php.
Referenced by AjaxRequestHandler\setJavascriptCallbackWrap().