You are here

protected function ConvertToPdf::replaceTokens in PDF using mPDF 8

Replaces tokens.

Parameters

string $text: The text that can contain tokens.

Return value

string Text with tokens replaced.

3 calls to ConvertToPdf::replaceTokens()
ConvertToPdf::setFilename in src/Conversion/ConvertToPdf.php
Sets the PDF filename.
ConvertToPdf::setFooter in src/Conversion/ConvertToPdf.php
Set footer for PDF file.
ConvertToPdf::setHeader in src/Conversion/ConvertToPdf.php
Set header for PDF file.

File

src/Conversion/ConvertToPdf.php, line 331

Class

ConvertToPdf
Class ConvertToPdf.

Namespace

Drupal\pdf_using_mpdf\Conversion

Code

protected function replaceTokens($text) {
  $data = [];
  if ($this->node) {
    $data['node'] = $this->node;
  }
  return $this->token
    ->replace($text, $data);
}