You are here

public function ViewsFieldTemplate::buildConfigurationForm in Calendar 8

Return form elements of extra configuration when adding View from template.

Parameters

array $form: The form in array.

\Drupal\Core\Form\FormStateInterface $form_state: The values from the form.

Return value

mixed Returns empty array.

Overrides ViewsDuplicateBuilderBase::buildConfigurationForm

File

src/Plugin/ViewsTemplateBuilder/ViewsFieldTemplate.php, line 79

Class

ViewsFieldTemplate
Views Template for all calendar fields.

Namespace

Drupal\calendar\Plugin\ViewsTemplateBuilder

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  $config_form = parent::buildConfigurationForm($form, $form_state);
  $replacements = $this
    ->getDefinitionValue('replacements');
  if (isset($replacements['base_path'])) {
    $config_form['base_path'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Base View Path'),
      '#description' => $this
        ->t('This view will be displayed by visiting this path on your site.'),
      '#default_value' => $replacements['base_path'],
      '#required' => TRUE,
    ];
  }
  return $config_form;
}