getFromPlaceholderResultsCache example


  public function get(array $elements) {
    // @todo remove this check when https://www.drupal.org/node/2367555 lands.     if (!$this->requestStack->getCurrentRequest()->isMethodCacheable()) {
      return FALSE;
    }

    // When rendering placeholders, special case auto-placeholdered elements:     // avoid retrieving them from cache again, or rendering them again.     if (isset($elements['#create_placeholder']) && $elements['#create_placeholder'] === FALSE) {
      $cached_placeholder_result = $this->getFromPlaceholderResultsCache($elements);
      if ($cached_placeholder_result !== FALSE) {
        return $cached_placeholder_result;
      }
    }

    $cached_element = parent::get($elements);

    if ($cached_element === FALSE) {
      return FALSE;
    }
    else {
      
Home | Imprint | This part of the site doesn't use cookies.