YVS1102 YVS1102 - 1 year ago 1116
PHP Question

Codeigniter and PHPWord

I'm trying to read some document. So I use PHPWord.

Here what i got in my library.

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

require_once APPPATH . '/third_party/PhpWord/Autoloader.php';
use PhpWord\Autoloader as Autoloader;

class Word extends Autoloader {


when i'm going to use it. I have this error :

Fatal error: Class 'PhpOffice\PhpWord\Autoloader' not found in D:\xampp\htdocs\jdih\application\libraries\Word.php on line 6
A PHP Error was encountered

Severity: Error

Message: Class 'PhpOffice\PhpWord\Autoloader' not found

Filename: libraries/Word.php

Line Number: 6


I have try this CodeIgniter PHPWord using as third_party but no help .

Here is the folder of my third_party. How can i fix the problem ?

enter image description here

Answer Source

Download PHPWord from here

And load the library like this.

//use PhpOffice\PhpWord\Autoloader;
//use PhpOffice\PhpWord\Settings;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download