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

package

Default

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

Echo $str with json header

echoString(string $str): void
static

Arguments

$str

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

Error popup

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

Arguments

$msg

string

$code

integer

outputHtml

outputHtml( $html,string $target): void
static

Arguments

$html

$target

string

No permission popup

outputNoPermission(): void
static

outputNotLoggedIn

outputNotLoggedIn(): void
static

Success popup

outputSuccess(string $msg): void
static

Arguments

$msg

string