You are here

public function SourceManager::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

src/SourceManager.php, line 51

Class

SourceManager
A plugin manager for source plugins.

Namespace

Drupal\tmgmt

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];
}