interface TokenResolverInterface in FillPDF 5.0.x
Same name and namespace in other branches
- 8.4 src/TokenResolverInterface.php \Drupal\fillpdf\TokenResolverInterface
Provides consistent token replacement for one or multiple entity sources.
@package Drupal\fillpdf
Hierarchy
- interface \Drupal\fillpdf\TokenResolverInterface
Expanded class hierarchy of TokenResolverInterface
All classes that implement TokenResolverInterface
3 files declare their use of TokenResolverInterface
- BackendProxy.php in src/
Service/ BackendProxy.php - FillPdfFormForm.php in src/
Form/ FillPdfFormForm.php - HandlePdfController.php in src/
Controller/ HandlePdfController.php
File
- src/
TokenResolverInterface.php, line 10
Namespace
Drupal\fillpdfView source
interface TokenResolverInterface {
/**
* Replaces all tokens in a given string with appropriate values.
*
* This is basically a replacement for \Drupal\Core\Utility\Token::replace(),
* only that it resolves image tokens, applies form and field replacements
* after token replacement, and returns FieldMapping objects.
*
* @param string $text
* An plain text string containing replaceable tokens.
* @param \Drupal\Core\Entity\EntityInterface[][] $data
* (optional) Multidimensional array of entities, keyed by entity ID and
* grouped by entity type.
* @param array $options
* (optional) A keyed array of settings and flags to control the token
* replacement process. Supported options are:
* - langcode: A language code to be used when generating locale-sensitive
* tokens.
* - callback: A callback function that will be used to post-process the
* array of token replacements after they are generated.
*
* @return \Drupal\fillpdf\FieldMapping
* An instance of a FieldMapping.
*
* @see \Drupal\Core\Utility\Token::replace()
*/
public function replace($text, array $data = [], array $options = []);
/**
* Returns the token service.
*
* @return \Drupal\token\Token
* The token service.
*/
public function getTokenService();
/**
* Returns the token entity mapper.
*
* @return \Drupal\token\TokenEntityMapperInterface
* The token entity mapper.
*/
public function getEntityMapper();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TokenResolverInterface:: |
public | function | Returns the token entity mapper. | 1 |
TokenResolverInterface:: |
public | function | Returns the token service. | 1 |
TokenResolverInterface:: |
public | function | Replaces all tokens in a given string with appropriate values. | 1 |