Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ControllerBase.php

function ControllerBase::cache

Returns the requested cache bin.

Parameters

string $bin: (optional) The cache bin for which the cache object should be returned, defaults to 'default'.

Return value

\Drupal\Core\Cache\CacheBackendInterface The cache object associated with the specified bin.

File

core/lib/Drupal/Core/Controller/ControllerBase.php, line 142

Class

ControllerBase
Utility base class for thin controllers.

Namespace

Drupal\Core\Controller

Code

protected function cache($bin = 'default') {
    return $this->container()
        ->get('cache.' . $bin);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal