You are here

function hook_esi_context in ESI: Edge Side Includes 7.3

ESI cache contexts allow the best granularity of cache-contexts for a user. For example, a natal module might provide granularity based on gender, where information is targeted at specific genders (according to recorded gender in a profile, for example).

Parameters

Object $account: A fully-loaded Drupal account.

Return value

Array Array where the keys are the context, and the value is the specific context for the user account provided.

1 function implements hook_esi_context()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

esi_esi_context in ./esi.module
Implements hook_esi_context().
1 invocation of hook_esi_context()
esi__get_user_contexts in ./esi.module
Get the ESI contexts for a single user.

File

./esi.api.inc, line 59
API documentation for hooks defined by the ESI module.

Code

function hook_esi_context($account) {
  $gender = my_module__get_gender($account);
  return array(
    'GENDER' => $gender,
  );
}