public function ContactLink::buildOptionsForm in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/contact/src/Plugin/views/field/ContactLink.php \Drupal\contact\Plugin\views\field\ContactLink::buildOptionsForm()
Default options form that provides the label widget that all fields should have.
Overrides LinkBase::buildOptionsForm
File
- core/
modules/ contact/ src/ Plugin/ views/ field/ ContactLink.php, line 27 - Contains \Drupal\contact\Plugin\views\field\ContactLink.
Class
- ContactLink
- Defines a field that links to the user contact page, if access is permitted.
Namespace
Drupal\contact\Plugin\views\fieldCode
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['text']['#title'] = $this
->t('Link label');
$form['text']['#required'] = TRUE;
$form['text']['#default_value'] = empty($this->options['text']) ? $this
->getDefaultLabel() : $this->options['text'];
}