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
Mostra file
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.
This method is required by the IModule interface.
loadJsonServices()
protected method
Load the service definitions.
This method is invoked by application automatically.