tag_attributes — Generate attributes for an HTML tag.

View-related functions

Summary

tag_attributes($attributes, $value = null)

Generate attributes for an HTML tag.

Parameters:
  • $attributes (array|string) – Attributes for the tag. If this is a string, it will assign both ‘name’ and ‘id’ attributes that value for the tag.
  • $value (string) –
Returns:

string

Usage

Examples

Adds attributes to HTML elements. Used mostly as a helper to other functions.

<form <?php echo tag_attributes($formAttributes); ?>>

See Also