You are here

ThemeCompilerPluginInterface.php in Theme Compiler 8

File

src/Plugin/ThemeCompilerPluginInterface.php
View source
<?php

namespace Drupal\theme_compiler\Plugin;


/**
 * An interface that all theme compiler plugins should use.
 */
interface ThemeCompilerPluginInterface {

  /**
   * Compiles and serves a response containing the requested compiler target.
   *
   * If the request for the compiler target incurs a cache miss, this method
   * will be called to generate a cacheable response. Otherwise, Drupal will
   * serve the cached response until expiration or invalidation.
   *
   * Optional parameters are defined entirely by each concrete plugin
   * implementation and should be written as distinct parameters on this method.
   *
   * @param \Drupal\theme_compiler\Plugin\ThemeCompilerTargetContext $context
   *   The compiler context containing common properties used by most (if not
   *   all) compilers.
   *
   * @return \Drupal\Core\Cache\CacheableResponseInterface
   *   A cacheable response for the requested compiler target.
   */
  public function serve(ThemeCompilerTargetContext $context);

}

Interfaces

Namesort descending Description
ThemeCompilerPluginInterface An interface that all theme compiler plugins should use.