public function LearningPathAchievementController::page_ajax in Opigno Learning path 8
Same name and namespace in other branches
- 3.x src/Controller/LearningPathAchievementController.php \Drupal\opigno_learning_path\Controller\LearningPathAchievementController::page_ajax()
Loads next achievements page with a AJAX.
Parameters
int $page: Page id.
Return value
\Drupal\Core\Ajax\AjaxResponse Response.
1 string reference to 'LearningPathAchievementController::page_ajax'
File
- src/
Controller/ LearningPathAchievementController.php, line 1132
Class
- LearningPathAchievementController
- Class LearningPathAchievementController.
Namespace
Drupal\opigno_learning_path\ControllerCode
public function page_ajax($page = 0) {
$selector = '#achievements-wrapper';
$content = $this
->build_page($page);
$response = new AjaxResponse();
if (!empty($content)) {
$response
->addCommand(new AppendCommand($selector, $content));
}
return $response;
}