Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 455 Bytes

html_attributes.md

File metadata and controls

15 lines (13 loc) · 455 Bytes

html_attributes()

Prepare the HTML attributes to output from an array. It's intended to use in the css and script functions.

html_attributes($attributes)

  • $attributes (array) - array with HTML attributes.
$attributes = [
	'type' => 'text',
	'id' => 'id-string',
	'class' => 'class1 class2',
	'required',
];
$output = '<input ' . html_attributes($attributes) . '>'; // <input type="text" id="input-id" class="class1 class2" required>