You are here

public function FormatManager::createUIInstance in Translation Management Tool 8

Returns a source plugin UI instance.

Parameters

string $plugin: Name of the source plugin.

Return value

\Drupal\tmgmt\SourcePluginUiInterface Instance a source plugin UI instance.

File

translators/tmgmt_file/src/Format/FormatManager.php, line 51

Class

FormatManager
A plugin manager for file format plugins.

Namespace

Drupal\tmgmt_file\Format

Code

public function createUIInstance($plugin) {
  if (!isset($this->ui[$plugin])) {
    $definition = $this
      ->getDefinition($plugin);
    $class = $definition['ui'];
    $this->ui[$plugin] = new $class(array(), $plugin, $definition);
  }
  return $this->ui[$plugin];
}