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

Breadcrumb

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

function FieldUI::getNextDestination

Returns the next redirect path in a multi-page sequence.

Parameters

array $destinations: An array of destinations to redirect to.

Return value

\Drupal\Core\Url|null The next destination to redirect to.

2 calls to FieldUI::getNextDestination()
FieldConfigEditForm::save in core/modules/field_ui/src/Form/FieldConfigEditForm.php
Form submission handler for the 'save' action.
FieldStorageAddForm::submitForm in core/modules/field_ui/src/Form/FieldStorageAddForm.php
Form submission handler.

File

core/modules/field_ui/src/FieldUI.php, line 41

Class

FieldUI
Static service container wrapper for Field UI.

Namespace

Drupal\field_ui

Code

public static function getNextDestination(array $destinations) {
    // If there are no valid destinations left, return here.
    if (empty($destinations)) {
        return NULL;
    }
    $next_destination = array_shift($destinations);
    if (is_array($next_destination)) {
        $next_destination['options']['query']['destinations'] = $destinations;
        $next_destination += [
            'route_parameters' => [],
        ];
        $next_destination = Url::fromRoute($next_destination['route_name'], $next_destination['route_parameters'], $next_destination['options']);
    }
    else {
        $options = UrlHelper::parse($next_destination);
        if ($destinations) {
            $options['query']['destinations'] = $destinations;
        }
        // Redirect to any given path within the same domain.
        // @todo Revisit this in https://www.drupal.org/node/2418219.
        $next_destination = Url::fromUserInput('/' . $options['path'], $options);
    }
    return $next_destination;
}

API Navigation

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