AjaxHelper
in package
Ajax helper This class will help to standardize the Ajax communication between server and client.
See the manual page for more info: https://manual.limesurvey.org/Backend_Ajax_protocol
Tags
Table of Contents
Methods
- createUrl() : string
- As Yii createUrl, but appends param ajax = 1 to url Use when creating Ajax action links, like button clicks that will open modals or save data.
- output() : void
- Echoes json with result set as $msg This is the custom json, that expects to be handled manually.
- outputError() : void
- Error popup
- outputHtml() : void
- outputNoPermission() : void
- No permission popup
- outputNotLoggedIn() : void
- outputSuccess() : void
- Success popup
- echoString() : void
- Echo $str with json header
Methods
createUrl()
As Yii createUrl, but appends param ajax = 1 to url Use when creating Ajax action links, like button clicks that will open modals or save data.
public
static createUrl(string $route[, array<string|int, mixed> $params = array() ]) : string
Parameters
- $route : string
- $params : array<string|int, mixed> = array()
Return values
stringoutput()
Echoes json with result set as $msg This is the custom json, that expects to be handled manually.
public
static output(string $msg) : void
Parameters
- $msg : string
-
message
outputError()
Error popup
public
static outputError(string $msg[, int $code = 0 ]) : void
Parameters
- $msg : string
- $code : int = 0
outputHtml()
public
static outputHtml(mixed $html, string $target) : void
Parameters
- $html : mixed
- $target : string
outputNoPermission()
No permission popup
public
static outputNoPermission() : void
outputNotLoggedIn()
public
static outputNotLoggedIn() : void
outputSuccess()
Success popup
public
static outputSuccess(string $msg) : void
Parameters
- $msg : string
echoString()
Echo $str with json header
private
static echoString(string $str) : void
Parameters
- $str : string