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

Breadcrumb

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

function AjaxPageState::handle

Overrides HttpKernelInterface::handle

File

core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php, line 27

Class

AjaxPageState
Expands the compressed ajax_page_state query parameter into an array.

Namespace

Drupal\Core\StackMiddleware

Code

public function handle(Request $request, $type = self::MAIN_REQUEST, $catch = TRUE) : Response {
    if ($type === static::MAIN_REQUEST) {
        if ($request->request
            ->has('ajax_page_state')) {
            $request->request
                ->set('ajax_page_state', $this->parseAjaxPageState($request->request
                ->all('ajax_page_state')));
        }
        elseif ($request->query
            ->has('ajax_page_state')) {
            $request->query
                ->set('ajax_page_state', $this->parseAjaxPageState($request->query
                ->all('ajax_page_state')));
        }
    }
    return $this->httpKernel
        ->handle($request, $type, $catch);
}

API Navigation

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