public function LearningPathController::trainingContentDocuments in Opigno Learning path 3.x
Training document block.
1 call to LearningPathController::trainingContentDocuments()
- LearningPathController::trainingContent in src/
Controller/ LearningPathController.php - Training content.
File
- src/
Controller/ LearningPathController.php, line 459
Class
- LearningPathController
- Class LearningPathController.
Namespace
Drupal\opigno_learning_path\ControllerCode
public function trainingContentDocuments(&$content, $group) {
// $TFTController = new TFTController();
// $listGroup = $TFTController->listGroup($group->id());
$tft_url = Url::fromRoute('tft.group', [
'group' => $group
->id(),
])
->toString();
$content['tabs'][] = $tft_url = [
'#markup' => '<div class="see-all"><a href="' . $tft_url . '">' . $this
->t('See all') . '</a></div>',
];
$block_render = $this
->attachBlock('opigno_documents_last_group_block', [
'group' => $group
->id(),
]);
$block_render["content"]['link'] = $tft_url;
$content['tab_content']['documents'] = isset($block_render["content"]["content"]) && !empty($block_render["content"]["content"]) ? [
'#type' => 'container',
'#attributes' => [
'id' => 'documents',
],
'block' => [
'content' => $block_render["content"],
],
] : [];
}