You are here

public function Link::buildOptionsForm in Profile 2 8

Default options form that provides the label widget that all fields should have.

Overrides FieldPluginBase::buildOptionsForm

File

src/Plugin/views/field/Link.php, line 36
Definition of Drupal\profile\Plugin\views\field\Link.

Class

Link
Field handler to present a link to the node.

Namespace

Drupal\profile\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  $form['text'] = array(
    '#type' => 'textfield',
    '#title' => t('Text to display'),
    '#default_value' => $this->options['text'],
  );
  parent::buildOptionsForm($form, $form_state);

  // The path is set by renderLink function so don't allow to set it.
  $form['alter']['path'] = array(
    '#access' => FALSE,
  );
  $form['alter']['external'] = array(
    '#access' => FALSE,
  );
}