From 6ed320311e6accc3874026a3fe1a38fc28d98c1b Mon Sep 17 00:00:00 2001 From: Michel Bardelmeijer Date: Mon, 9 Sep 2019 13:55:59 +0200 Subject: [PATCH] Add documentation for image closure support --- docs/templates-processing.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/templates-processing.rst b/docs/templates-processing.rst index 5b32aa18..e9c0b969 100644 --- a/docs/templates-processing.rst +++ b/docs/templates-processing.rst @@ -63,6 +63,11 @@ Example: $templateProcessor->setImageValue('CompanyLogo', 'path/to/company/logo.png'); $templateProcessor->setImageValue('UserLogo', array('path' => 'path/to/logo.png', 'width' => 100, 'height' => 100, 'ratio' => false)); + $templateProcessor->setImageValue('FeatureImage', function () { + // Closure will only be executed if the replacement tag is found in the template + + return array('path' => SlowFeatureImageGenerator::make(), 'width' => 100, 'height' => 100, 'ratio' => false); + }); cloneBlock """"""""""