You are here

AuthcacheP13nJSONContent.inc in Authenticated User Page Caching (Authcache) 7.2

Define content encoder for JSON.

File

modules/authcache_p13n/includes/AuthcacheP13nJSONContent.inc
View source
<?php

/**
 * @file
 * Define content encoder for JSON.
 */

/**
 * JSON content encoder.
 */
class AuthcacheP13nJSONContent implements AuthcacheP13nContentEncoderInterface {

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

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

}

Classes

Namesort descending Description
AuthcacheP13nJSONContent JSON content encoder.