Problem/Motivation

Since Drupal works with render arrays all over the place, it's important to be able to easily convert them to custom elements.

Let's provide some API helper for that.

CommentFileSizeAuthor
#2 custom_elements_add_helper.patch1.19 KBfago

Comments

fago created an issue. See original summary.

fago’s picture

Status: Active » Needs review
StatusFileSize
new1.19 KB

attached patch implements this via a new factory method helper on the CustomElement class.

fago’s picture

Status: Needs review » Reviewed & tested by the community

This seems to work fine. Only thing we might consider is ignoring empty elements, but that can be improved after commit as well imo.

  • mostepaniukvm committed 7f5b03e on 8.x-2.x authored by fago
    Issue #3167430 by fago: Create a helper for converting render arrays to...
mostepaniukvm’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.