public function TmgmtSmartlingDashboardLink::render in TMGMT Translator Smartling 8
Same name and namespace in other branches
- 8.4 src/Plugin/views/field/TmgmtSmartlingDashboardLink.php \Drupal\tmgmt_smartling\Plugin\views\field\TmgmtSmartlingDashboardLink::render()
- 8.2 src/Plugin/views/field/TmgmtSmartlingDashboardLink.php \Drupal\tmgmt_smartling\Plugin\views\field\TmgmtSmartlingDashboardLink::render()
- 8.3 src/Plugin/views/field/TmgmtSmartlingDashboardLink.php \Drupal\tmgmt_smartling\Plugin\views\field\TmgmtSmartlingDashboardLink::render()
inheritdoc}
Overrides FieldPluginBase::render
File
- src/
Plugin/ views/ field/ TmgmtSmartlingDashboardLink.php, line 36 - Definition of Drupal\tmgmt_smartling\Plugin\views\field\TmgmtSmartlingDashboardLink
Class
- TmgmtSmartlingDashboardLink
- Field handler to flag the node type.
Namespace
Drupal\tmgmt_smartling\Plugin\views\fieldCode
public function render(ResultRow $values) {
$job = $values->_entity;
$translator = $job
->hasTranslator() ? $job
->getTranslatorPlugin() : null;
if (empty($translator) || !$translator instanceof SmartlingTranslator) {
return '';
}
$proj_id = $job
->getTranslator()
->getSetting('project_id');
$file_name = $translator
->getFileName($job);
return [
'#theme' => 'smartling_dashboard_link',
'#proj_id' => $proj_id,
'#file_name' => $file_name,
];
}