function drupal_render_cid_create

7.x drupal_render_cid_create($elements)

Creates the cache ID for a renderable element.

This creates the cache ID string, either by returning the #cache['cid'] property if present or by building the cache ID out of the #cache['keys'] and, optionally, the #cache['granularity'] properties.


$elements: A renderable array.

Return value

The cache ID string, or FALSE if the element may not be cached.

2 calls to drupal_render_cid_create()
drupal_render_cache_get in drupal/includes/
Gets the rendered output of a renderable element from the cache.
drupal_render_cache_set in drupal/includes/
Caches the rendered output of a renderable element.


drupal/includes/, line 6238
Common functions that many Drupal modules will need to reference.


function drupal_render_cid_create($elements) {
  if (isset($elements['#cache']['cid'])) {
    return $elements['#cache']['cid'];
  elseif (isset($elements['#cache']['keys'])) {
    $granularity = isset($elements['#cache']['granularity']) ? $elements['#cache']['granularity'] : NULL;
    // Merge in additional cache ID parts based provided by drupal_render_cid_parts().
    $cid_parts = array_merge($elements['#cache']['keys'], drupal_render_cid_parts($granularity));
    return implode(':', $cid_parts);
  return FALSE;