You are here

function TranslatorController::enable in Translation Management Tool 8

Enables a Translator object.

Parameters

\Drupal\tmgmt\TranslatorInterface $tmgmt_translator: The Translator object to enable.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse A redirect response to the tmgmt listing page.

File

src/Controller/TranslatorController.php, line 23

Class

TranslatorController
Route controller class for the tmgmt translator entity.

Namespace

Drupal\tmgmt\Controller

Code

function enable(TranslatorInterface $tmgmt_translator) {
  $tmgmt_translator
    ->enable()
    ->save();
  return new RedirectResponse(url('admin/tmgmt/translators', array(
    'absolute' => TRUE,
  )));
}