Skip to content

Commit 6ed3203

Browse files
committed
Add documentation for image closure support
1 parent 5a68ef6 commit 6ed3203

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/templates-processing.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ Example:
6363
6464
$templateProcessor->setImageValue('CompanyLogo', 'path/to/company/logo.png');
6565
$templateProcessor->setImageValue('UserLogo', array('path' => 'path/to/logo.png', 'width' => 100, 'height' => 100, 'ratio' => false));
66+
$templateProcessor->setImageValue('FeatureImage', function () {
67+
// Closure will only be executed if the replacement tag is found in the template
68+
69+
return array('path' => SlowFeatureImageGenerator::make(), 'width' => 100, 'height' => 100, 'ratio' => false);
70+
});
6671
6772
cloneBlock
6873
""""""""""

0 commit comments

Comments
 (0)