public function TestEmbeddedEntityForm::buildForm

File

paragraphs/tests/modules/paragraphs_test/src/Form/TestEmbeddedEntityForm.php, line 56

Class

TestEmbeddedEntityForm
A class to build a form that embeds a content entity form.

Namespace

Drupal\paragraphs_test\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {

  // Based on the logic of Layout Builder's InlineBlock form processing,
  // the entity form is being inserted via process callback.
  return [
    'embedded_entity_form' => [
      '#type' => 'container',
      '#process' => [
        [
          static::class,
          'processEmbeddedEntityForm',
        ],
      ],
      '#entity' => $this->entity,
    ],
  ];
}