krotovroman
Добавил это
$this->section = $this->phpword->addSection();
$this->section->addImage(
$data['image'] = $_POST['image'],
array(
'width' => 100,
'height' => 100,
'marginTop' => -1,
'marginLeft' => -1,
'wrappingStyle' => 'behind'
)
);
if (empty($data['image'])) {
$data['image'] = "";
} else {
$data['image'] = $_POST['image'];
};
Ошибка выходит
Fatal error: Uncaught exception 'PhpOffice\PhpWord\Exception\InvalidImageException' in /assets/lib/example/library/phpword/Element/Image.php:383 Stack trace: #0 /assets/lib/example/library/phpword/Element/Image.php(138): PhpOffice\PhpWord\Element\Image->checkImage('kimg.jpg') #1 [internal function]: PhpOffice\PhpWord\Element\Image->__construct(' kimg.jpg', Array) #2 /assets/lib/example/library/phpword/Element/AbstractContainer.php(145): ReflectionClass->newInstanceArgs(Array) #3 [internal function]: PhpOffice\PhpWord\Element\AbstractContainer->addElement('Image', 'kimg.jpg', Array) #4 /assets/lib/example/library/phpword/Element/AbstractContainer.php(112): call_user_func_array(Array, Array) #5 /wp-content/theme in /assets/lib/example/library/phpword/Element/Image.php on line 383