PHP Класс 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
С версии: 3.1
Автор: Carl G. Mathisen ([email protected])
Наследование: extends Prado\TService
Показать файл Открыть проект

Открытые методы

Метод Описание
init ( $xml ) Initializes this module.
run ( ) Runs the service.

Защищенные методы

Метод Описание
createJsonResponse ( $service, $properties, $config ) Renders content provided by TJsonResponse::getJsonContent() as javascript in JSON format.
loadJsonServices ( $config ) Load the service definitions.

Описание методов

createJsonResponse() защищенный Метод

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

init() публичный Метод

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

loadJsonServices() защищенный Метод

Load the service definitions.
protected loadJsonServices ( $config )

run() публичный Метод

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