You are here

protected function ParagraphsWidget::isFeatureEnabled in Paragraphs 8

Checks if a widget feature is enabled or not.

Parameters

string $feature: Feature name to check.

Return value

bool TRUE if the feature is enabled, otherwise FALSE.

4 calls to ParagraphsWidget::isFeatureEnabled()
ParagraphsWidget::buildHeaderActions in src/Plugin/Field/FieldWidget/ParagraphsWidget.php
Builds header actions.
ParagraphsWidget::buildModalAddForm in src/Plugin/Field/FieldWidget/ParagraphsWidget.php
Builds an add paragraph button for opening of modal form.
ParagraphsWidget::duplicateButtonAccess in src/Plugin/Field/FieldWidget/ParagraphsWidget.php
Check duplicate button access.
ParagraphsWidget::formElement in src/Plugin/Field/FieldWidget/ParagraphsWidget.php
Uses a similar approach to populate a new translation.

File

src/Plugin/Field/FieldWidget/ParagraphsWidget.php, line 2753

Class

ParagraphsWidget
Plugin implementation of the 'entity_reference_revisions paragraphs' widget.

Namespace

Drupal\paragraphs\Plugin\Field\FieldWidget

Code

protected function isFeatureEnabled($feature) {
  $features = $this
    ->getSetting('features');
  if (!empty($features[$feature])) {
    return TRUE;
  }
  return FALSE;
}