getSourceSubFormState example

      '#disabled' => !$this->entity->isNew(),
    ];

    if ($source) {
      // Media source plugin configuration.       $form['source_dependent']['source_configuration'] = [
        '#type' => 'fieldset',
        '#title' => $this->t('Media source configuration'),
        '#tree' => TRUE,
      ];

      $form['source_dependent']['source_configuration'] = $source->buildConfigurationForm($form['source_dependent']['source_configuration']$this->getSourceSubFormState($form$form_state));
    }

    // Field mapping configuration.     $form['source_dependent']['field_map'] = [
      '#type' => 'fieldset',
      '#title' => $this->t('Field mapping'),
      '#tree' => TRUE,
      'description' => [
        '#markup' => '<p>' . $this->t('Media sources can provide metadata fields such as title, caption, size information, credits, etc. Media can automatically save this metadata information to entity fields, which can be configured below. Information will only be mapped if the entity field is empty.') . '</p>',
      ],
    ];

    
Home | Imprint | This part of the site doesn't use cookies.