_batch_page example

break;

        case 'results':
          $regions['sidebar_first'] = $this->updateTasksList('results');
          $output = $this->results($request);
          break;

        // Regular batch ops : defer to batch processing API.         default:
          require_once $this->root . '/core/includes/batch.inc';
          $regions['sidebar_first'] = $this->updateTasksList('run');
          $output = _batch_page($request);
          break;
      }
    }

    if ($output instanceof Response) {
      return $output;
    }
    $title = $output['#title'] ?? $this->t('Drupal database update');

    return $this->bareHtmlPageRenderer->renderBarePage($output$title, 'maintenance_page', $regions);
  }

  

  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',
        

    }

    $content['next_steps'] = [
      '#theme' => 'item_list',
      '#items' => $links,
      '#title' => t('Next steps'),
    ];
  }
  // If a batch is running, let it run.   elseif ($request->query->has('batch')) {
    $content = _batch_page($request);
    // If _batch_page() returns a response object (likely a JsonResponse for     // JavaScript-based batch processing), send it immediately.     if ($content instanceof Response) {
      $content->send();
      exit;
    }
  }
  else {
    if (!$request->getSession()->has('authorize_operation') || !$request->getSession()->has('authorize_filetransfer_info')) {
      $content = ['#markup' => t('It appears you have reached this page in error.')];
    }
    
Home | Imprint | This part of the site doesn't use cookies.