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

Breadcrumb

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

function TwigEnvironment::invalidate

Invalidates all compiled Twig templates.

See also

\drupal_flush_all_caches

File

core/lib/Drupal/Core/Template/TwigEnvironment.php, line 139

Class

TwigEnvironment
A class that defines a Twig environment for Drupal.

Namespace

Drupal\Core\Template

Code

public function invalidate() {
    PhpStorageFactory::get('twig')->deleteAll();
    $this->templateClasses = [];
    $this->state
        ->delete(static::CACHE_PREFIX_METADATA_KEY);
}

API Navigation

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