Answers for "drupal 8 form redirect"

0

drupal 8 form redirect

use Drupal\Core\Url;

// Url to redirect.
$path = '/my-path';
// query string
$path_param = [
 'abc' => '123',
 'xyz' => '456'
];

// Use below if you have to redirect on your known url.
$url = Url::fromUserInput($path, ['query' => $path_param]);

$form_state->setRedirectUrl($url);
Posted by: Guest on October-15-2020

Browse Popular Code Answers by Language