You are here

class Forms in FZ152 8

Provides an annotated Fz152 plugin for config forms.

Plugin annotation


@Fz152(
  id = "forms",
)

Hierarchy

Expanded class hierarchy of Forms

2 string references to 'Forms'
Forms::getSettingsPage in src/Plugin/Fz152/Forms.php
If you want to add settings as tab to main settings you can define it here.
fz152.schema.yml in config/schema/fz152.schema.yml
config/schema/fz152.schema.yml

File

src/Plugin/Fz152/Forms.php, line 15

Namespace

Drupal\fz152\Plugin\Fz152
View source
class Forms extends Fz152PluginBase {

  /**
   * {@inheritdoc}
   */
  public function getSettingsPage() {
    return [
      'path' => 'forms',
      'title' => 'Forms',
      'form' => Fz152SettingsForms::class,
      'weight' => 0,
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getForms() {
    $config = \Drupal::config('fz152.forms');
    $forms_settings = $config
      ->get('forms');
    $forms = [];
    if (!empty($forms_settings)) {
      foreach (explode(PHP_EOL, $forms_settings) as $form_id) {
        $form_id_exploded = explode('|', $form_id);
        $forms[] = [
          'form_id' => $form_id_exploded[0],
          'weight' => isset($form_id_exploded[1]) ? $form_id_exploded[1] : NULL,
        ];
      }
    }
    return $forms;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
Forms::getForms public function Returns a list of form to and confirmation for sending private data. Overrides Fz152PluginBase::getForms
Forms::getSettingsPage public function If you want to add settings as tab to main settings you can define it here. Overrides Fz152PluginBase::getSettingsPage
Fz152PluginBase::getId public function Overrides Fz152PluginInterface::getId
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. 92
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.