You are here

public function UserController::trainingModule in Opigno statistics 8

Same name and namespace in other branches
  1. 3.x src/Controller/UserController.php \Drupal\opigno_statistics\Controller\UserController::trainingModule()

Builds render array for a user course statistics page.

Parameters

\Drupal\user\UserInterface $user: User.

\Drupal\group\Entity\GroupInterface $training: Training.

\Drupal\opigno_module\Entity\OpignoModule $module: Module.

Return value

array Render array.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 string reference to 'UserController::trainingModule'
opigno_statistics.routing.yml in ./opigno_statistics.routing.yml
opigno_statistics.routing.yml

File

src/Controller/UserController.php, line 1580

Class

UserController
Class UserController.

Namespace

Drupal\opigno_statistics\Controller

Code

public function trainingModule(UserInterface $user, GroupInterface $training, OpignoModule $module) {
  $content = [];
  $content[] = $this
    ->buildModuleDetails($user, $training, NULL, $module);
  $content['#attached']['library'][] = 'opigno_statistics/user';
  return $content;
}