You are here

function hook_authcache_p13n_assembly in Authenticated User Page Caching (Authcache) 7.2

Declare fragment assemblies containing personalized information.

Return an associative array where the key represents the fragment assembly id and the value an array with the following keys:

  • partial: An associative array with the following key-value pairs:

    • renderer: The name of the class used to build the markup. The class must implement the AuthcacheP13nFragmentInterface.
    • validator: (Optional) The name of the class used to validate the parameters for the fragment renderer. The class must implement the AuthcacheP13nFragmentValidator interface. If not given, the 'renderer' instance is used if it implements the interface mentioned before.
    • loader: (Optional) The name of the class used to load the necessary data. The class must implement the AuthcacheP13nFragmentLoader interface. If not given, the 'renderer' instance is used if it implements the interface mentioned before.
    • access: (Optional) The name of a class used to check access to the data. The class must implement the AuthcacheP13nFragmentAccess interface. If not given, the 'renderer' instance is used if it implements the interface mentioned before.
  • cache maxage: (Optional) The number of seconds a rendered fragment should be cacheable in the users browser or in intermediate cache servers.
  • cache granularity (Optional) A bitmask describing the criteria used to distinguish between multiple variants of a fragment. A combination of the following constants can be used:

  • bootstrap phase: (Optional) The minimal bootstrap phase necessary to render the fragment. One of the DRUPAL_BOOTSTRAP_X constants.
7 functions implement hook_authcache_p13n_assembly()

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

authcache_ajax_test_authcache_p13n_assembly in modules/authcache_ajax/tests/authcache_ajax_test.module
Implements hook_authcache_p13n_assembly().
authcache_esi_test_authcache_p13n_assembly in modules/authcache_esi/tests/authcache_esi_test.module
Implements hook_authcache_p13n_assembly().
authcache_field_authcache_p13n_assembly in modules/authcache_field/authcache_field.module
Implements hook_authcache_p13n_assembly().
authcache_flag_authcache_p13n_assembly in modules/authcache_flag/authcache_flag.module
Implements hook_authcache_p13n_assembly().
authcache_p13n_test_authcache_p13n_assembly in modules/authcache_p13n/tests/authcache_p13n_test.module
Implements hook_authcache_p13n_assembly().

... See full list

1 invocation of hook_authcache_p13n_assembly()
authcache_p13n_assembly_info in modules/authcache_p13n/authcache_p13n.module
Return information about fragment assemblies implemented by other modules.

File

modules/authcache_p13n/authcache_p13n.api.php, line 91
Documentation for hooks provided by the authcache personalization module.

Code

function hook_authcache_p13n_assembly() {
  return array(
    'flags' => array(
      'admin name' => 'All flags',
      'admin group' => 'Flag',
      'admin description' => 'All flags on a page',
      'cache maxage' => 600,
      'bootstrap phase' => DRUPAL_BOOTSTRAP_FULL,
      'fragment f1' => array(
        '#class' => 'AuthcacheFlagFlagFragment',
        '#arguments' => array(
          'bookmarks',
        ),
        '#member_of' => 'partial f1',
        '#key' => 'renderer',
      ),
      'partial f1' => array(
        '#collection' => 'partial f1',
        '#member_of' => 'partials',
        '#key' => 'f1',
      ),
      'fragment f2' => array(
        '#class' => 'AuthcacheFlagFlagFragment',
        '#arguments' => array(
          'friends',
        ),
        '#member_of' => 'partial f2',
        '#key' => 'renderer',
      ),
      'partial f2' => array(
        '#collection' => 'partial f2',
        '#member_of' => 'partials',
        '#key' => 'f2',
      ),
    ),
  );
}