public static FieldUI::getNextDestination(array $destinations)
Returns the next redirect path in a multipage sequence.
Parameters
array $destinations: An array of destinations to redirect to.
Return value
\Drupal\Core\Url|null The next destination to redirect to.
File
- core/modules/field_ui/src/FieldUI.php, line 41
Class
- FieldUI
- Static service container wrapper for Field UI.
Namespace
Drupal\field_ui
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 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 += array ( 'route_parameters' => array (), ); $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 ; } |
Please login to continue.