diff core/lib/Drupal/Core/Template/Attribute.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
line wrap: on
line diff
--- a/core/lib/Drupal/Core/Template/Attribute.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/core/lib/Drupal/Core/Template/Attribute.php	Thu May 09 15:34:47 2019 +0100
@@ -262,6 +262,20 @@
   }
 
   /**
+   * Gets the class attribute value if set.
+   *
+   * This method is implemented to take precedence over hasClass() for Twig 2.0.
+   *
+   * @return \Drupal\Core\Template\AttributeValueBase
+   *   The class attribute value if set.
+   *
+   * @see twig_get_attribute()
+   */
+  public function getClass() {
+    return $this->offsetGet('class');
+  }
+
+  /**
    * Checks if the class array has the given CSS class.
    *
    * @param string $class