Html::$uriAttributes

Same name in other branches
  1. 9 core/lib/Drupal/Component/Utility/Html.php \Drupal\Component\Utility\Html::uriAttributes
  2. 10 core/lib/Drupal/Component/Utility/Html.php \Drupal\Component\Utility\Html::uriAttributes
  3. 11.x core/lib/Drupal/Component/Utility/Html.php \Drupal\Component\Utility\Html::uriAttributes

All attributes that may contain URIs.

  • The attributes 'code' and 'codebase' are omitted, because they only exist for the <applet> tag. The time of Java applets has passed.
  • The attribute 'icon' is omitted, because no browser implements the <command> tag anymore. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/command.
  • The 'manifest' attribute is omitted because it only exists for the <html> tag. That tag only makes sense in a HTML-served-as-HTML context, in which case relative URLs are guaranteed to work.

Type: string[]

See also

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes

https://stackoverflow.com/questions/2725156/complete-list-of-html-tag-a…

File

core/lib/Drupal/Component/Utility/Html.php, line 56

Class

Html
Provides DOMDocument helpers for parsing and serializing HTML strings.

Namespace

Drupal\Component\Utility

Code

protected static $uriAttributes = [
    'href',
    'poster',
    'src',
    'cite',
    'data',
    'action',
    'formaction',
    'srcset',
    'about',
];

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.