AjaxHelper

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

since 2016-09-27
author

Olle Härstedt

Methods

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.

createUrl(string $route, array $params = array()) : string
static

Arguments

$route

string

$params

array

Response

string

Echoes json with result set as $msg This is the custom json, that expects to be handled manually.

output(string $msg) : void
static

Arguments

$msg

string

message

Success popup

outputSuccess(string $msg) : void
static

Arguments

$msg

string

Error popup

outputError(string $msg, int $code) : void
static

Arguments

$msg

string

$code

int

No permission popup

outputNoPermission() : void
static

outputNotLoggedIn

outputNotLoggedIn() : void
static

Echo $str with json header

echoString(\ls\ajax\JsonOutput $str) : void
static

Arguments