We used to use that in Drupal 7:

<?php print drupal_attributes($attributes); ?>

Now in Drupal 8, you do that:

<?php print new Attributes($attributes); ?>

Remeber, to use that, you need to add this in the beginning of the file:

<?php use Drupal\Core\Template\Attribute; ?>

Leave a comment