Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().
Overrides WidgetBase::settingsForm
public function settingsForm(array $form, array &$form_state) {
$elements = parent::settingsForm($form, $form_state);
$elements['placeholder_url'] = array(
'#type' => 'textfield',
'#title' => t('Placeholder for URL'),
'#default_value' => $this
->getSetting('placeholder_url'),
'#description' => t('Text that will be shown inside the field until a value is entered. This hint is usually a sample value or a brief description of the expected format.'),
);
$elements['placeholder_title'] = array(
'#type' => 'textfield',
'#title' => t('Placeholder for link text'),
'#default_value' => $this
->getSetting('placeholder_title'),
'#description' => t('Text that will be shown inside the field until a value is entered. This hint is usually a sample value or a brief description of the expected format.'),
'#states' => array(
'invisible' => array(
':input[name="instance[settings][title]"]' => array(
'value' => DRUPAL_DISABLED,
),
),
),
);
return $elements;
}