Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BatchController.php

function BatchController::batchPage

Returns a system batch page.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The current request object.

Return value

\Symfony\Component\HttpFoundation\Response|array A \Symfony\Component\HttpFoundation\Response object or render array.

Throws

\Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException

1 string reference to 'BatchController::batchPage'
system.routing.yml in core/modules/system/system.routing.yml
core/modules/system/system.routing.yml

File

core/modules/system/src/Controller/BatchController.php, line 51

Class

BatchController
Controller routines for batch routes.

Namespace

Drupal\system\Controller

Code

public function batchPage(Request $request) {
    $output = _batch_page($request);
    if ($output === FALSE) {
        throw new AccessDeniedHttpException();
    }
    elseif ($output instanceof Response) {
        return $output;
    }
    elseif (isset($output)) {
        $title = $output['#title'] ?? NULL;
        $page = [
            '#type' => 'page',
            '#title' => $title,
            '#show_messages' => FALSE,
            'content' => $output,
        ];
        // Also inject title as a page header (if available).
        if ($title) {
            $page['header'] = [
                '#type' => 'page_title',
                '#title' => $title,
            ];
        }
        return $page;
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal