You are here

interface YamlFormTokenManagerInterface in YAML Form 8

Defines an interface for token manager classes.

Hierarchy

Expanded class hierarchy of YamlFormTokenManagerInterface

All classes that implement YamlFormTokenManagerInterface

4 files declare their use of YamlFormTokenManagerInterface
EmailYamlFormHandler.php in src/Plugin/YamlFormHandler/EmailYamlFormHandler.php
RemotePostYamlFormHandler.php in src/Plugin/YamlFormHandler/RemotePostYamlFormHandler.php
YamlFormAdminSettingsForm.php in src/Form/YamlFormAdminSettingsForm.php
YamlFormBlock.php in src/Plugin/Block/YamlFormBlock.php

File

src/YamlFormTokenManagerInterface.php, line 10

Namespace

Drupal\yamlform
View source
interface YamlFormTokenManagerInterface {

  /**
   * Replace tokens in text.
   *
   * @param string|array $text
   *   A string of text that may contain tokens.
   * @param \Drupal\Core\Entity\EntityInterface|null $entity
   *   A YAML Form or YAML Form submission entity.
   * @param array $data
   *   (optional) An array of keyed objects.
   * @param array $options
   *   (optional) A keyed array of settings and flags to control the token
   *   replacement process.
   *
   * @return string|array
   *   Text or array with tokens replaced.
   *
   * @see \Drupal\Core\Utility\Token::replace
   */
  public function replace($text, EntityInterface $entity = NULL, array $data = [], array $options = []);

  /**
   * Build token tree link if token.module is installed.
   */
  public function buildTreeLink();

}

Members

Namesort descending Modifiers Type Description Overrides
YamlFormTokenManagerInterface::buildTreeLink public function Build token tree link if token.module is installed. 1
YamlFormTokenManagerInterface::replace public function Replace tokens in text. 1