I have to add a great PHP word to the Joomla 2.5 project.
I've added the PHPWord files to the plugin folder (can not be the right option) and the following code is
$ phpWord = new \ library \ phpOffice \ phpWord \ PhpWord (); The class is not found because it is loading automatically. How do I load these classes in Joomla and there will be a better folder than plugins that will automatically load?
I have added these lines
JLoader :: discover ('PhpWord', JPATH_LIBRARIES. '/ PhpOffice / PhpWord /'); $ PhpWord = New PhpWord; Phpword.php inside phpWord folder and autoloader.php, as well as many other scripts.
As mentioned in the above commentary, how do they import a library for Joomla 2.5 and Joomla 3 Please.
Now assuming that the tutorial is correct and JLoader :: Search is working, I would say that the problem is that you have PHPWord :: in the plugin folder and with JLider :: Find that you are searching in / library / phpOffice / phpword / . / P>
then
- Copy / PhpOffice / PhpWord / libraries
- Try to use again
JLoader :: discover ('PhpWord' Reading JPATH_LIBRARIES PhpWord document I have found that you can also directly require the library and can use it like this:// Be sure that your Joomla path match is required 'library / phpdrd / autoloader.fp'; \ phpOffice \ phpWord \ Autoloader :: register (); // New da Creating Status ... $ phpWord = new \ PhpOffice \ PhpWord \ PhpWord ();
No comments:
Post a Comment