Hello,
Using replacePlaceholderImage, the placeholder needs to be added to the alternative text of the image using MS Word or any other DOCX editor. On https://www.phpdocx.com/api-documentation/templates/replace-placeholder-image-Word-document you can read more information and sampes about using this metod.
If you need to replace a text placeholder by an image, you need to use a WordFragment and replaceVariableByWordFragment:
$image = new WordFragment($docx, 'document');
$image->addImage(array('src' => 'image.png' , 'scaling' => 50, 'float' => 'right', 'textWrap' => 1));
$docx->replaceVariableByWordFragment(array('PLACEHOLDER' => $image ), array('type' => 'block'));
You can read more information about both methods on the following pages of the practical guide:
- https://www.phpdocx.com/documentation/practical/pictures-and-images (Replacing pictures/images in a template section)
- https://www.phpdocx.com/documentation/practical/wordfragments-and-wordml (Working with templates section)
Regards.