PHP Class Horde_Core_Ajax_Application, horde

Copyright 2010-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Michael Slusarz ([email protected])
Mostra file Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$data mixed The data returned from the doAction() call.
$tasks object The list of (possibly) unsolicited tasks/data to do for this request.

Protected Properties

Property Type Description
$_action string The action to perform.
$_app string The Horde application.
$_handlers array AJAX method handlers.
$_vars Horde_Variables The request variables.

Public Methods

Method Description
__construct ( string $app, Horde_Variables $vars, string $action = null, string $token = null ) Constructor.
__get ( $name )
addHandler ( string $class ) : Horde_Core_Ajax_Application_Handler Add an AJAX method handler.
addTask ( string $name, mixed $data, string $app = null ) Add task to response data.
callAction ( string $action ) : mixed Explicitly call an 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.
send ( ) Send AJAX response to the browser.

Protected Methods

Method Description
_getHandler ( ) : mixed Return the Handler for the current action.
_init ( ) Application initialization code.

Method Details

__construct() public method

Constructor.
public __construct ( string $app, Horde_Variables $vars, string $action = null, string $token = null )
$app string The application name.
$vars Horde_Variables Form/request data.
$action string The AJAX action to perform.
$token string Session token.

__get() public method

public __get ( $name )

_getHandler() protected method

Return the Handler for the current action.
protected _getHandler ( ) : mixed
return mixed A Horde_Core_Ajax_Application_Handler object, or null if handler is not found.

_init() protected method

Application initialization code.
protected _init ( )

addHandler() final public method

Add an AJAX method handler.
final public addHandler ( string $class ) : Horde_Core_Ajax_Application_Handler
$class string Classname of a Handler to add.
return Horde_Core_Ajax_Application_Handler Handler object.

addTask() public method

Add task to response data.
public addTask ( string $name, mixed $data, string $app = null )
$name string Task name.
$data mixed Task data.
$app string Overwrite default application (since 2.5.0).

callAction() public method

Explicitly call an action.
Since: 2.5.0
public callAction ( string $action ) : mixed
$action string The action to call.
return mixed The response from the called action.

doAction() public method

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 ( )

send() public method

Send AJAX response to the browser.
public send ( )

Property Details

$_action protected_oe property

The action to perform.
protected string $_action
return string

$_app protected_oe property

The Horde application.
protected string $_app
return string

$_handlers protected_oe property

AJAX method handlers.
protected array $_handlers
return array

$_vars protected_oe property

The request variables.
protected Horde_Variables $_vars
return Horde_Variables

$data public_oe property

The data returned from the doAction() call.
public mixed $data
return mixed

$tasks public_oe property

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