You are here

class WingsuitExtension in Gin Layout Builder 8.2

Class WingsiutTheme.

@package Drupal\keytec_theme\TwigExtension

Hierarchy

  • class \Drupal\Core\Template\TwigExtension extends \Drupal\Core\Template\Twig_Extension

Expanded class hierarchy of WingsuitExtension

1 string reference to 'WingsuitExtension'
wingsuit_ui_patterns.services.yml in modules/wingsuit_ui_patterns/wingsuit_ui_patterns.services.yml
modules/wingsuit_ui_patterns/wingsuit_ui_patterns.services.yml
1 service uses WingsuitExtension
wingsuit_ui_patterns.twig in modules/wingsuit_ui_patterns/wingsuit_ui_patterns.services.yml
Drupal\wingsuit_ui_patterns\TwigExtension\WingsuitExtension

File

modules/wingsuit_ui_patterns/src/TwigExtension/WingsuitExtension.php, line 15

Namespace

Drupal\wingsuit_ui_patterns\TwigExtension
View source
class WingsuitExtension extends TwigExtension {

  /**
   * @inheritdoc
   */
  public function getFunctions() {
    return [
      new TwigFunction('ws_itok', [
        $this,
        'wsItok',
      ]),
      new TwigFunction('uuid', [
        $this,
        'wsUuid',
      ]),
    ];
  }

  /**
   * @inheritdoc
   */
  public function getName() {
    return 'wingsuit_companion';
  }

  /**
   * Uses deployment key as cache key for generated svgs.
   *
   * @return mixed|null
   */
  public static function wsItok() {
    return urlencode(Settings::get('deployment_identifier'));
  }

  /**
   * Returns a unique id.
   *
   * @return mixed|null
   */
  public static function wsUuid() {
    return Html::getId(\Drupal::service('uuid')
      ->generate());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TwigExtension::$dateFormatter protected property The date formatter.
TwigExtension::$renderer protected property The renderer.
TwigExtension::$themeManager protected property The theme manager.
TwigExtension::$urlGenerator protected property The URL generator.
TwigExtension::attachLibrary public function Attaches an asset library to the template, and hence to the response.
TwigExtension::bubbleArgMetadata protected function Bubbles Twig template argument's cacheability & attachment metadata.
TwigExtension::createAttribute public function Creates an Attribute object.
TwigExtension::escapeFilter public function Overrides twig_escape_filter().
TwigExtension::escapePlaceholder public function Provides a placeholder wrapper around ::escapeFilter.
TwigExtension::getActiveTheme public function Gets the name of the active theme.
TwigExtension::getActiveThemePath public function Gets the path of the active theme.
TwigExtension::getFilters public function
TwigExtension::getLink public function Gets a rendered link from a url object.
TwigExtension::getNodeVisitors public function
TwigExtension::getPath public function Generates a URL path given a route name and parameters.
TwigExtension::getTokenParsers public function
TwigExtension::getUrl public function Generates an absolute URL given a route name and parameters.
TwigExtension::isUrlGenerationSafe public function Determines at compile time whether the generated URL will be safe.
TwigExtension::renderVar public function Wrapper around render() for twig printed output.
TwigExtension::safeJoin public function Joins several strings together safely.
TwigExtension::setDateFormatter Deprecated public function Sets the date formatter.
TwigExtension::setGenerators Deprecated public function Sets the URL generator.
TwigExtension::setThemeManager Deprecated public function Sets the theme manager.
TwigExtension::setUrlGenerator Deprecated public function Sets the URL generator.
TwigExtension::withoutFilter public function Removes child elements from a copy of the original array.
TwigExtension::__construct public function Constructs \Drupal\Core\Template\TwigExtension.
WingsuitExtension::getFunctions public function @inheritdoc Overrides TwigExtension::getFunctions
WingsuitExtension::getName public function @inheritdoc Overrides TwigExtension::getName
WingsuitExtension::wsItok public static function Uses deployment key as cache key for generated svgs.
WingsuitExtension::wsUuid public static function Returns a unique id.