I`m trying to make this system to make a word archive and save it.. but at first it said that string was a special character.. so i just change it from:
"use PhpOffice\PhpWord\Shared\String;"
to "use PhpOffice\PhpWord\Shared\String as POString;"
and i changed it too when the string was.. so i press to get the word file but it doesn't work.. just throw me this:
Fatal error: Uncaught Error: Class 'PhpOffice\PhpWord\Shared\String' not found in C:\xampp\htdocs\texmom\PhpWord\Element\Text.php:139 Stack trace: #0 C:\xampp\htdocs\texmom\PhpWord\Element\Text.php(59): PhpOffice\PhpWord\Element\Text->setText('PROVEEDORES') #1 [internal function]: PhpOffice\PhpWord\Element\Text->__construct('PROVEEDORES', Array) #2 C:\xampp\htdocs\texmom\PhpWord\Element\AbstractContainer.php(145): ReflectionClass->newInstanceArgs(Array) #3 [internal function]: PhpOffice\PhpWord\Element\AbstractContainer->addElement('Text', 'PROVEEDORES', Array) #4 C:\xampp\htdocs\texmom\PhpWord\Element\AbstractContainer.php(112): call_user_func_array(Array, Array) #5 C:\xampp\htdocs\texmom\report\providers-word.php(16): PhpOffice\PhpWord\Element\AbstractContainer->__call('addtext', Array) #6 {main} thrown in C:\xampp\htdocs\texmom\PhpWord\Element\Text.php on line 139
(proveedores means providers in spanish) just a name.
any clue?
you must be using an old version of PHPWord. This class was renamed some time ago.
Please use version 0.14
thank you a lot! now i have to change almost everything but for sure it's going to work! 馃槃
@troosan I have a question, it's possible to change my old phpword folder with the new (yeah it is but..) without touching my code in that folder? cuz' it would be a problem doing all of it again.. hope you asnwer me soon. meanwhile I'll change it one by one not touching my code (i have a long time without programming so I'm learning again) hehehe. Thank you!
@carlosvr90 I don't know which version you were using before and how you were loading the dependencies, but the standard way to do so now is through Composer. I hope you won't have to rewrite your whole application!
Most helpful comment
you must be using an old version of PHPWord. This class was renamed some time ago.
Please use version 0.14