By berdir on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.0.x
Introduced in version:
8.0.0-beta4
Issue links:
Description:
To display a link with only a #fragment, the special route can be used.
Drupal 7
$fragment_only_url = url('', array('external' => TRUE, 'fragment' => 'fragment'));
Drupal 8
$fragment_only_url = \Drupal::url('<none>', [], ['fragment' => 'fragment']);
Impacts:
Module developers