\Horde_Core_Ajax_Application

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.

Summary

Methods
Properties
Constants
__construct()
__get()
addHandler()
doAction()
addTask()
send()
callAction()
$data
$tasks
$app
$vars
No constants found
_init()
_getHandler()
$_action
$_app
$_handlers
$_vars
N/A
No private methods found
No private properties found
N/A

Properties

$data

$data : mixed

The data returned from the doAction() call.

Type

mixed

$tasks

$tasks : object

The list of (possibly) unsolicited tasks/data to do for this request.

Type

object

$app

$app : string

The current application

Type

string

$vars

$vars : \Horde_Variables

The Variables object.

Type

\Horde_Variables

$_action

$_action : string

The action to perform.

Type

string

$_app

$_app : string

The Horde application.

Type

string

$_handlers

$_handlers : array

AJAX method handlers.

Type

array

$_vars

$_vars : \Horde_Variables

The request variables.

Type

\Horde_Variables

Methods

__construct()

__construct(string  $app, \Horde_Variables  $vars, string  $action = null, string  $token = null) 

Constructor.

Parameters

string $app

The application name.

\Horde_Variables $vars

Form/request data.

string $action

The AJAX action to perform.

string $token

Session token.

Throws

\Horde_Exception

__get()

__get(  $name) 

Parameters

$name

addHandler()

addHandler(string  $class) : \Horde_Core_Ajax_Application_Handler

Add an AJAX method handler.

Parameters

string $class

Classname of a Handler to add.

Returns

\Horde_Core_Ajax_Application_Handler

Handler object.

doAction()

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.

Throws

\Horde_Exception

addTask()

addTask(string  $name, mixed  $data, string  $app = null) 

Add task to response data.

Parameters

string $name

Task name.

mixed $data

Task data.

string $app

Overwrite default application (since 2.5.0).

send()

send() 

Send AJAX response to the browser.

callAction()

callAction(string  $action) : mixed

Explicitly call an action.

Parameters

string $action

The action to call.

Returns

mixed —

The response from the called action.

_init()

_init() 

Application initialization code.

_getHandler()

_getHandler() : mixed

Return the Handler for the current action.

Returns

mixed —

A Horde_Core_Ajax_Application_Handler object, or null if handler is not found.