Add documentation for image closure support
This commit is contained in:
parent
5a68ef600b
commit
6ed320311e
|
|
@ -63,6 +63,11 @@ Example:
|
||||||
|
|
||||||
$templateProcessor->setImageValue('CompanyLogo', 'path/to/company/logo.png');
|
$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('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
|
cloneBlock
|
||||||
""""""""""
|
""""""""""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue