Forum


Replies: 6   Views: 2250
Addimage null error
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 05-03-2020 - 17:19

Hello,

That error doesn't seem from phpdocx but from the code you are running. As you can check in the error you get:

Call to a member function addImage() on null

This line means that when calling:

$rooms_image->addImage($image_options);

$rooms_image is null, not a CreateDocx/CreateDocxFromTemplate object, so you get an error because you can't call addImage from null. We recommend you to check how you are creating the $rooms_image object.

Regards.