Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get all element attributes and content
$attributes = array_merge($element->getAttributes(), $element->getContent()->getAttributes());
array_walk($attributes, function(&$value, $handle) use ($element, $attributes) {
$value = !empty($element->$handle) ? $element->$handle : $attributes[$handle];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.