Change record status: 
Introduced in branch: 

\Drupal\Core\Form\ConfirmFormBase is the Drupal 8 equivalent of confirm_form(). See the change notice for that conversion here: confirm_form() deprecated in favor of \Drupal\Core\Form\ConfirmFormBase

Instead of specifying the path to return to when the "Cancel" button is clicked, you now specify the route name, and optionally, any route parameters or options.

use Drupal\Core\Url;

  public function getCancelUrl() {
    return new Url('system_admin', array(), array(
        'query' => array(
          'destination' => 'admin/config',
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other updates done


Gribnif’s picture

The example uses getCancelUrl(), which I assume is incorrect based on the subject of this notice.

hgoto’s picture

Probably, since getCancelRoute() was renamed to getCancelUrl(), the sample code is correct. The title can be improved, maybe :)

#2305023: Rename getCancelRoute to getCancelUrl