Horde_Core_Ajax_Application
in package
Defines the AJAX interface for an application.
Copyright 2010-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Tags
Table of Contents
Properties
- $app : string
- $data : mixed
- The data returned from the doAction() call.
- $tasks : object
- The list of (possibly) unsolicited tasks/data to do for this request.
- $vars : Horde_Variables
- $_action : string
- The action to perform.
- $_app : string
- The Horde application.
- $_handlers : array<string|int, mixed>
- AJAX method handlers.
- $_vars : Horde_Variables
- The request variables.
Methods
- __construct() : mixed
- Constructor.
- __get() : mixed
- addHandler() : Horde_Core_Ajax_Application_Handler
- Add an AJAX method handler.
- addTask() : mixed
- Add task to response data.
- callAction() : mixed
- Explicitly call an action.
- doAction() : mixed
- Performs the AJAX action. The AJAX action should return either raw data (which will be output to the browser to be parsed by the HordeCore JS framework), or a Horde_Ajax_Core_Response object, which will be sent unaltered.
- send() : mixed
- Send AJAX response to the browser.
- _getHandler() : mixed
- Return the Handler for the current action.
- _init() : mixed
- Application initialization code.
Properties
$app
public
string
$app
The current application
$data
The data returned from the doAction() call.
public
mixed
$data
= \null
$tasks
The list of (possibly) unsolicited tasks/data to do for this request.
public
object
$tasks
= \null
$vars
public
Horde_Variables
$vars
The Variables object.
$_action
The action to perform.
protected
string
$_action
$_app
The Horde application.
protected
string
$_app
$_handlers
AJAX method handlers.
protected
array<string|int, mixed>
$_handlers
= array()
$_vars
The request variables.
protected
Horde_Variables
$_vars
Methods
__construct()
Constructor.
public
__construct(string $app, Horde_Variables $vars[, string $action = null ][, string $token = null ]) : mixed
Parameters
- $app : string
-
The application name.
- $vars : Horde_Variables
-
Form/request data.
- $action : string = null
-
The AJAX action to perform.
- $token : string = null
-
Session token.
Tags
__get()
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
addHandler()
Add an AJAX method handler.
public
final addHandler(string $class) : Horde_Core_Ajax_Application_Handler
Parameters
- $class : string
-
Classname of a Handler to add.
Return values
Horde_Core_Ajax_Application_Handler —Handler object.
addTask()
Add task to response data.
public
addTask(string $name, mixed $data[, string $app = null ]) : mixed
Parameters
- $name : string
-
Task name.
- $data : mixed
-
Task data.
- $app : string = null
-
Overwrite default application (since 2.5.0).
callAction()
Explicitly call an action.
public
callAction(string $action) : mixed
Parameters
- $action : string
-
The action to call.
Tags
Return values
mixed —The response from the called action.
doAction()
Performs the AJAX action. The AJAX action should return either raw data (which will be output to the browser to be parsed by the HordeCore JS framework), or a Horde_Ajax_Core_Response object, which will be sent unaltered.
public
doAction() : mixed
Tags
send()
Send AJAX response to the browser.
public
send() : mixed
_getHandler()
Return the Handler for the current action.
protected
_getHandler() : mixed
Return values
mixed —A Horde_Core_Ajax_Application_Handler object, or null if handler is not found.
_init()
Application initialization code.
protected
_init() : mixed