5
I’m trying to put the Phpword library in codeigniter, so I downloaded Phpword and extracted the Phpword folder and the Phpword.php file into the third_party folder of CI. After this I created in the folder Libraries a file with the name word.php
which would extend the functionality of Phpword.php.
So far so good, but when I call the library Word.php
in my controller I get the following error
Class PHPWORD not found in (filepath/Word.php).
I have heard that before doing this I would need to call the autoloader file, I tried that way too and did not succeed, someone knowing help me ?
Follow the file code Word.PHP
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once APPPATH."/third_party/PHPWord.php";
class Word extends PHPWord {
public function __construct() {
parent::__construct();
}
}
I followed a part in this tutorial I found on the internet :
http://www.ahowto.net/php/creating-ms-word-document-using-codeigniter-and-phpword/
What version of phpword are you using ?
– gmsantos
I am using version 0.12.0 stable. got it from github : https://github.com/PHPOffice/PHPWord
– ThECoDeR