You are here

public function LearningPathAchievementController::training_steps_ajax in Opigno Learning path 3.x

Same name and namespace in other branches
  1. 8 src/Controller/LearningPathAchievementController.php \Drupal\opigno_learning_path\Controller\LearningPathAchievementController::training_steps_ajax()

Loads steps for a training with a AJAX.

Parameters

\Drupal\group\Entity\Group $group: Group.

Return value

\Drupal\Core\Ajax\AjaxResponse Response.

1 string reference to 'LearningPathAchievementController::training_steps_ajax'
opigno_learning_path.routing.yml in ./opigno_learning_path.routing.yml
opigno_learning_path.routing.yml

File

src/Controller/LearningPathAchievementController.php, line 1008

Class

LearningPathAchievementController
Class LearningPathAchievementController.

Namespace

Drupal\opigno_learning_path\Controller

Code

public function training_steps_ajax(Group $group) {
  $selector = '#training_steps_' . $group
    ->id();
  $content = $this
    ->build_lp_steps($group);
  $content['#attributes']['data-ajax-loaded'] = TRUE;
  $response = new AjaxResponse();
  $response
    ->addCommand(new ReplaceCommand($selector, $content));
  return $response;
}