Skip to content
Snippets Groups Projects
Commit e43e2c0d authored by Liam Morland's avatar Liam Morland
Browse files

Issue #3277525: Create HandlePdfController::getFilename()

parent 05178a08
No related branches found
No related tags found
No related merge requests found
......@@ -199,6 +199,25 @@ class HandlePdfController extends ControllerBase {
return $this->handlePopulatedPdf($fillpdf_form, $populated_pdf, $context, $filename, $entities);
}
/**
* Return the token-replaced filename of a populated PDF file.
*
* Given the same context, this will return the same filename that would be
* used in ::populatePdf().
*
* @param array $context
* The FillPDF context.
*
* @return string
* The filename.
*/
public function getFilename(array $context): string {
$fillpdf_form = FillPdfForm::load($context['fid']);
$entities = $this->contextManager->loadEntities($context);
return $this->buildFilename($fillpdf_form->title->value, $entities);
}
/**
* Builds the filename of a populated PDF file.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment