public function ResultsController::getResults in FullCalendar 8
Same name and namespace in other branches
- 8.5 src/Controller/ResultsController.php \Drupal\fullcalendar\Controller\ResultsController::getResults()
- 8.2 src/Controller/ResultsController.php \Drupal\fullcalendar\Controller\ResultsController::getResults()
- 8.3 src/Controller/ResultsController.php \Drupal\fullcalendar\Controller\ResultsController::getResults()
- 8.4 src/Controller/ResultsController.php \Drupal\fullcalendar\Controller\ResultsController::getResults()
Ajax callback to refresh calendar view.
Parameters
\Drupal\views\Entity\View $view: Fully-loaded view entity.
string $display_id: Display ID.
Return value
\Drupal\Core\Ajax\AjaxResponse|void
1 string reference to 'ResultsController::getResults'
File
- src/
Controller/ ResultsController.php, line 25
Class
- ResultsController
- Controller for handling ajax requests.
Namespace
Drupal\fullcalendar\ControllerCode
public function getResults(View $view, $display_id) {
$response = new AjaxResponse();
if (!$view) {
return $response;
}
$view = $view
->getExecutable();
if (!$view
->access($display_id)) {
return $response;
}
if (!$view
->setDisplay($display_id)) {
return $response;
}
$request = \Drupal::request();
$args = $request->request
->get('view_args', '');
$args = explode('/', $args);
$view
->setExposedInput($request->request
->all());
$view
->preExecute($args);
$view
->execute($display_id);
$content = $view
->buildRenderable($display_id, $args);
$rendered = \Drupal::service('renderer')
->renderRoot($content);
$response
->addCommand(new ResultsCommand($rendered));
return $response;
}