You are here

public function ExtraFieldPlusFormManager::hasSettingsForm in Extra Field Settings Provider 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/ExtraFieldPlusFormManager.php \Drupal\extra_field_plus\Plugin\ExtraFieldPlusFormManager::hasSettingsForm()

Checks if extra field has settings form.

Parameters

string $plugin_id: The extra field plugin id.

Return value

bool True if plugin has form, false otherwise.

File

src/Plugin/ExtraFieldPlusFormManager.php, line 71

Class

ExtraFieldPlusFormManager
Manages Extra Field Plus plugins settings forms.

Namespace

Drupal\extra_field_plus\Plugin

Code

public function hasSettingsForm($plugin_id) {
  try {
    $plugin = $this
      ->getFactory()
      ->createInstance($plugin_id);
  } catch (Exception $e) {

    // Return false for wrong plugins.
    return FALSE;
  }
  return !empty($plugin
    ->getSettingsForm()) ? TRUE : FALSE;
}