You are here

public static function PatternSettingTypeBase::create in UI Patterns Settings 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/PatternSettingTypeBase.php \Drupal\ui_patterns_settings\Plugin\PatternSettingTypeBase::create()
1 call to PatternSettingTypeBase::create()
TokenSettingTypeBase::create in src/Plugin/TokenSettingTypeBase.php
Creates an instance of the plugin.
1 method overrides PatternSettingTypeBase::create()
TokenSettingTypeBase::create in src/Plugin/TokenSettingTypeBase.php
Creates an instance of the plugin.

File

src/Plugin/PatternSettingTypeBase.php, line 63

Class

PatternSettingTypeBase
Base class for UI Patterns Setting plugins.

Namespace

Drupal\ui_patterns_settings\Plugin

Code

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
  $plugin = new static($configuration, $plugin_id, $plugin_definition);

  /** @var \Drupal\Core\StringTranslation\TranslationInterface $translation */
  $translation = $container
    ->get('string_translation');
  $plugin
    ->setStringTranslation($translation);
  return $plugin;
}