fail to use jpgraph in CI4 |
Hello,
I need to use php jpgraph library, so i have put it in a folder (because of the large number of files) Jpgraph located in app\Libraries so path to jpgraph class file is : app\Libraries\Jpgraph\jpgraph.php in a controller : PHP Code: use App\Libraries\Jpgraph\jpgraph; I got : Error, Class "App\Controllers\Graph" not found if I change Graph to jpgraph PHP Code: $this->jpgraph = new jpgraph(); i got : ErrorException, Uncaught Error: Class "App\Libraries\Jpgraph\jpgraph" not found in [...]/app/Controllers I migh have done something wrong, but what?
In file app\Libraries\Jpgraph\jpgraph.php set namespace App\Libraries\Jpgraph\jpgraph? If not set probaly new \jpgraph()
It seems JpGraph is not autoloadable.
https://jpgraph.net/download/manuals/chu...e.example0 I recommend you require (adjust the file path): PHP Code: require_once ('jpgraph/jpgraph.php'); and write like: PHP Code: $this->jpgraph = new \Graph();
Ok, Thanks to you both, will try it.
Meanwhile have found this : https://packagist.org/packages/amenadiel/jpgraph But for now, have to fix problems with twig use. Have a nice day, Eric
Fatal error: Uncaught Error: Class "App\Libraries\Jpgraph\jpgraph\Text" not found in /home/[...]/traces/app/Libraries/Jpgraph/jpgraph.php
Sorry, I give up.
JpGraph is not namespaced. So there is no "App\Libraries\Jpgraph\jpgraph\Text" class.
|
Welcome Guest, Not a member yet? Register Sign In |