PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

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
Extended by TApplicationComponent
Extended by TService implements IService
Extended by 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
Methods summary
public
# init( mixed $xml )

Initializes this module. This method is required by the IModule interface.

Initializes this module. This method is required by the IModule interface.

Parameters

$xml
mixed
configuration for this module, can be null

Overrides

TService::init()
protected
# loadJsonServices( mixed $config )

Load the service definitions.

Load the service definitions.

Parameters

$config
mixed
configuration for this module, can be null
public
# run( )

Runs the service. This method is invoked by application automatically.

Runs the service. This method is invoked by application automatically.

Overrides

TService::run()
protected
# createJsonResponse( mixed $service, mixed $properties, mixed $config )

Renders content provided by TJsonResponse::getJsonContent() as javascript in JSON format.

Renders content provided by TJsonResponse::getJsonContent() as javascript in JSON format.

Methods inherited from TService
getEnabled(), getID(), setEnabled(), setID()
Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __construct(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO