Active
Project:
Drupal core
Version:
main
Component:
render system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Nov 2026 at 15:50 UTC
Updated:
17 Nov 2026 at 15:50 UTC
Jump to comment: Most recent
#3494015: Link render element overwrites CSS class fixed a bug where Link options and attributes where not merged. However, Url attributes class is now no longer output as they are overwritten by Link attributes class even when Link has none.
$url = Url::fromRoute('user.login')->setOption('attributes', [
'class' => ['button'],
]);
$link = Link::fromTextAndUrl(t('Log in'), $url)->toString();
Merge Link options, Link attributes and Url options when rendering Link
\Drupal\Core\Url attributes class are printed
None
None
None
-
Comments