You are here

public function DefaultTwigExtension::get_progress in Opigno Learning path 8

Same name and namespace in other branches
  1. 3.x src/TwigExtension/DefaultTwigExtension.php \Drupal\opigno_learning_path\TwigExtension\DefaultTwigExtension::get_progress()

Returns current user progress.

Return value

array|mixed|null Current user progress.

File

src/TwigExtension/DefaultTwigExtension.php, line 334

Class

DefaultTwigExtension
Class DefaultTwigExtension.

Namespace

Drupal\opigno_learning_path\TwigExtension

Code

public function get_progress() {
  $group = \Drupal::routeMatch()
    ->getParameter('group');
  $account = \Drupal::currentUser();
  $progress_service = \Drupal::service('opigno_learning_path.progress');
  $content = $progress_service
    ->getProgressAjaxContainer($group
    ->id(), $account
    ->id(), '', 'group-page');
  return render($content);
}