You are here

public function Settings::buildForm in Config Ignore 8

Same name and namespace in other branches
  1. 8.3 src/Form/Settings.php \Drupal\config_ignore\Form\Settings::buildForm()
  2. 8.2 src/Form/Settings.php \Drupal\config_ignore\Form\Settings::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/Settings.php, line 36

Class

Settings
Provides a setting UI for Config Ignore.

Namespace

Drupal\config_ignore\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL) {
  $config_ignore_settings = $this
    ->config('config_ignore.settings');
  $form['ignored_config_entities'] = [
    '#type' => 'textarea',
    '#rows' => 25,
    '#title' => $this
      ->t('Configuration entity names to ignore'),
    '#description' => $this
      ->t('One configuration name per line.<br />Examples: <ul><li>user.settings</li><li>views.settings</li><li>contact.settings</li><li>webform.webform.* (will ignore all config entities that starts with <em>webform.webform</em>)</li><li>*.contact_message.custom_contact_form.* (will ignore all config entities that starts with <em>.contact_message.custom_contact_form.</em> like fields attached to a custom contact form)</li><li>* (will ignore everything)</li><li>~webform.webform.contact (will force import for this configuration, even if ignored by a wildcard)</li></ul>'),
    '#default_value' => implode(PHP_EOL, $config_ignore_settings
      ->get('ignored_config_entities')),
    '#size' => 60,
  ];
  return parent::buildForm($form, $form_state);
}