Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ViewExecutable.php

function ViewExecutable::hasFormElements

Determines if this view has form elements.

Return value

bool TRUE if this view contains handlers with views form implementations, FALSE otherwise.

File

core/modules/views/src/ViewExecutable.php, line 2501

Class

ViewExecutable
Represents a view as a whole.

Namespace

Drupal\views

Code

public function hasFormElements() {
    if ($this->getDisplay()
        ->usesFields()) {
        foreach ($this->field as $field) {
            if (method_exists($field, 'viewsForm')) {
                return TRUE;
            }
        }
    }
    $area_handlers = array_merge(array_values($this->header), array_values($this->footer));
    $empty = empty($this->result);
    foreach ($area_handlers as $area) {
        if (method_exists($area, 'viewsForm') && !$area->viewsFormEmpty($empty)) {
            return TRUE;
        }
    }
    return FALSE;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal