Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
$url = \Drupal\Core\Url::fromRoute('<front>', [], ['atttributes' => ['class' => ['foo']]);
/**
* link(text, url, { 'class': ['bar'] });
*/
This should append a class, not replace the existing foo class.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#5 | 2847611-4.patch | 1.98 KB | webflo |
Comments
Comment #2
dawehnerComment #3
dawehnerComment #5
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #6
dan2k3k4 CreditAttribution: dan2k3k4 at Amazee Labs commentedRead through the code, good use of mergeOptions.
Seems to be all good from my side.
Comment #7
tim.plunkettCame to review this, already RTBC. +1 from me!
Comment #8
alexpottCommitted and pushed ba06831 to 8.4.x and 936ca9e to 8.3.x. Thanks!
I thought about the BC impact but the code change shows us that this is changing it to work as intended. And the worst that can happen is an additional classes are added.