You are here

class AuthcacheP13nJSONContent in Authenticated User Page Caching (Authcache) 7.2

JSON content encoder.

Hierarchy

Expanded class hierarchy of AuthcacheP13nJSONContent

2 string references to 'AuthcacheP13nJSONContent'
AuthcacheP13nTestRequestBuilder::testRequestResourcesNullFragments in modules/authcache_p13n/tests/authcache_p13n.request-builder.test
Cover authcache_p13n_request_resources().
authcache_p13n_authcache_p13n_request in modules/authcache_p13n/authcache_p13n.module
Implements hook_authcache_p13n_request().

File

modules/authcache_p13n/includes/AuthcacheP13nJSONContent.inc, line 10
Define content encoder for JSON.

View source
class AuthcacheP13nJSONContent implements AuthcacheP13nContentEncoderInterface {

  /**
   * {@inheritdoc}
   */
  public function contentType() {
    return 'text/javascript';
  }

  /**
   * {@inheritdoc}
   */
  public function encode($result) {
    return json_encode($result);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AuthcacheP13nJSONContent::contentType public function Return an appropriate internet media type string. Overrides AuthcacheP13nContentEncoderInterface::contentType
AuthcacheP13nJSONContent::encode public function Serialize a result produced by AuthcacheP13nContentBuilder::build(). Overrides AuthcacheP13nContentEncoderInterface::encode