You are here

protected function ContactForm::renderName in Contact Storage 8

Render form label.

1 call to ContactForm::renderName()
ContactForm::render in src/Plugin/views/field/ContactForm.php
Renders the field.

File

src/Plugin/views/field/ContactForm.php, line 44

Class

ContactForm
Field handler to provide the label of a contact form.

Namespace

Drupal\contact_storage\Plugin\views\field

Code

protected function renderName($form_id, $values) {
  if ($form_id !== NULL && $form_id !== '') {
    $type = $this->formStorage
      ->load($form_id);
    return $type ? $this
      ->sanitizeValue($type
      ->label()) : '';
  }
  return $this
    ->sanitizeValue($form_id);
}