You are here

public function YouTubePluginForm::buildForm in CKEditor Youtube 8

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/YouTubePluginForm.php, line 30

Class

YouTubePluginForm
Provide settings for CKEditor Youtube plugin.

Namespace

Drupal\ckeditor_youtube\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('ckeditor_youtube.settings');
  $form['ckeditor_youtube_settings']['library_path'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Enter the path the CKEditor Youtube plugin is installed at.'),
    '#required' => TRUE,
    '#description' => $this
      ->t('By default this is "libraries/youtube".'),
    '#default_value' => $config
      ->get('library_path'),
  ];
  return parent::buildForm($form, $form_state);
}