I created a custom form in Drupal 8. I remember we can redirect to custom path in Drupal 7 with $form_state['redirect'] = 'mycustompath';
in a submission handler.
How can I achieve the same in Drupal 8?
I know I should use submitForm()
.
public function submitForm (array &$form, FormStateInterface $form_state) {
// Redirect users.
}