PHP Class Prado\Web\Services\TJsonService

TJsonService manages a set of {@link TJsonResponse}, each representing specific response with javascript content. The service parameter, referring to the ID of the service, specifies which javascript content to be provided to end-users. To use TJsonService, configure it in application configuration as follows, where each JSON response is specified via a <json> element. Initial property values can be configured in a <json> element. PHP configuration style: 'services' => array( 'get_article' => array( 'class' => 'Path.To.JsonResponseClass1', 'properties' => array( ... ) ) ) To retrieve the JSON content provided by "get_article", use the URL index.php?json=get_article
Since: 3.1
Author: Carl G. Mathisen ([email protected])
Inheritance: extends Prado\TService
Datei anzeigen Open project: pradosoft/prado

Public Methods

Method Description
init ( $xml ) Initializes this module.
run ( ) Runs the service.

Protected Methods

Method Description
createJsonResponse ( $service, $properties, $config ) Renders content provided by TJsonResponse::getJsonContent() as javascript in JSON format.
loadJsonServices ( $config ) Load the service definitions.

Method Details

createJsonResponse() protected method

Renders content provided by TJsonResponse::getJsonContent() as javascript in JSON format.
protected createJsonResponse ( $service, $properties, $config )

init() public method

This method is required by the IModule interface.
public init ( $xml )

loadJsonServices() protected method

Load the service definitions.
protected loadJsonServices ( $config )

run() public method

This method is invoked by application automatically.
public run ( )