You are here

public function AllowIframedSiteConfigForm::buildForm in Allow site iframing 8

Same name and namespace in other branches
  1. 3.0.x src/Form/AllowIframedSiteConfigForm.php \Drupal\allow_iframed_site\Form\AllowIframedSiteConfigForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

src/Form/AllowIframedSiteConfigForm.php, line 55

Class

AllowIframedSiteConfigForm

Namespace

Drupal\allow_iframed_site\Form

Code

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

  // Load our default configuration.
  $config = $this
    ->config('allow_iframed_site.settings');

  // Set the default condition configuration.
  foreach ($this->conditions as $key => $condition) {
    $condition
      ->setConfiguration($config
      ->get($key) ?? []);
    $form += $condition
      ->buildConfigurationForm($form, $form_state);
  }
  return parent::buildForm($form, $form_state);
}