I want to template my docx file using array of images. Array size could change. I need something like loop, but PHPWord documentation hasn't information about it.
I try to use cloneBlock(), but unfortunately i can't use images here (or I don't know how to use it).
In .docx:
${block_name} Image: ${image} Description: ${description} ${/block_name}
In PHP:
$replacements = [
['image' => '???', 'description' => 'Flower'],
['image' => '???', 'description' => 'House']
];
$templateProcessor->cloneBlock('block_name', 0, true, false, $replacements);
I expect to transform something like that:
['path_to_file', 'path_to_file', 'path_to_file', ..., 'path_to_file']
into .docx
file with all images from array.