Class TJsonService
TJsonService class provides to end-users javascript content response in JSON format.
TJsonService manages a set of 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,
<service id="json" class="System.Web.Services.TJsonService"> <json id="get_article" class="Path.To.JsonResponseClass1" .../> <json id="register_rating" class="Path.To.JsonResponseClass2" .../> </service>
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
- TComponent
-
TApplicationComponent
-
TService implements IService
-
TJsonService
Package: System\Web\Services
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Wei Zhuo <weizhuo[at]gmail[dot]com>
Author: Carl G. Mathisen <carlgmathisen@gmail.com>
Since: 3.1
Located at Web/Services/TJsonService.php
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Wei Zhuo <weizhuo[at]gmail[dot]com>
Author: Carl G. Mathisen <carlgmathisen@gmail.com>
Since: 3.1
Located at Web/Services/TJsonService.php
public
|
|
protected
|
|
public
|
|
protected
|
#
createJsonResponse( mixed $service, mixed $properties, mixed $config )
Renders content provided by TJsonResponse::getJsonContent() as javascript in JSON format. |
getEnabled(),
getID(),
setEnabled(),
setID()
|
getApplication(),
getRequest(),
getResponse(),
getService(),
getSession(),
getUser(),
publishAsset(),
publishFilePath()
|
GLOBAL_RAISE_EVENT_LISTENER
|