RedirectResponse not working I'm in the process of porting my modules from D7 to D8. No real problems so far, but...

I have a multistep form from where I need to redirect to /node/add/xyz in the last step. (All required input form data is stored in D8 TempStore before the redirect).
In d7 I used the simple and functional drupal_goto('node/add/xyz') function which is gone in D8 for whatever reason.

I looked into core modules to see how it is done in the D8 way and it seems RedirectResponse() from the Symfony routing system is the way to go. However doing something like this:

return new RedirectResponse(url('node/add/xyz', array('absolute' =&gt; TRUE)));


But this is silently ignored, no error, nothing. I read that doing RedirectResponse from somewhere in the code may not work. So my next idea of doing it was to use a form redirect in this way:

$form_state['redirect_route'] = array(
  'route_name' =&gt; 'node.add',
  'route_parameters' =&gt; array(
    'node_type' =&gt; 'xyz',
  ),
);


even without any effect. I'm out of ideas and wish drupal_goto() back. Hopefully someone out there can help me out!

Thanks in advance
bzrudi
Form redirects haven't changed between Drupal 7 and 8; you still need to use $form_state['redirect'] (incidentally drupal_goto() shouldn't be used within form submissions in Drupal 7, it can mess things up).

Within your form class's submitForm() method, you can use

$form_state['redirect'] = 'node';


Or

$form_state['redirect'] = array(
  'node/123',
  array(
    'query' =&gt; array(
      'foo' =&gt; 'bar',
    ),
    'fragment' =&gt; 'baz',
  ),
);


Full info can be found in the FormBuilder::redirectForm() docs