function BatchController::batchPageTitle

Same name and namespace in other branches
  1. 9 core/modules/system/src/Controller/BatchController.php \Drupal\system\Controller\BatchController::batchPageTitle()
  2. 8.9.x core/modules/system/src/Controller/BatchController.php \Drupal\system\Controller\BatchController::batchPageTitle()
  3. 11.x core/modules/system/src/Controller/BatchController.php \Drupal\system\Controller\BatchController::batchPageTitle()

The _title_callback for the system.batch_page.html route.

Return value

string The page title.

1 string reference to 'BatchController::batchPageTitle'
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 87

Class

BatchController
Controller routines for batch routes.

Namespace

Drupal\system\Controller

Code

public function batchPageTitle(Request $request) {
  $batch =& batch_get();
  if (!($request_id = $request->query
    ->get('id'))) {
    return '';
  }
  // Retrieve the current state of the batch.
  if (!$batch) {
    $batch = $this->batchStorage
      ->load($request_id);
  }
  if (!$batch) {
    return '';
  }
  $current_set = _batch_current_set();
  return !empty($current_set['title']) ? $current_set['title'] : '';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.