Welcome Guest, Not a member yet? Register   Sign In
Trying to use a barcode library with Composer and CI4
#1

Hi

I could successfuly install (in a CI4 install in subfolder) the following libraries with Composer: dompdf and guzzlehttp
Then, I use both in the Controller, etc.

Code:
...
...
use Dompdf\Dompdf;
use GuzzleHttp\Client;
...
...
$client = new \GuzzleHttp\Client(['http_errors' => false]);
$dompdf = new Dompdf();
...
...

But I cannot make the same with the following one:

https://github.com/picqer/php-barcode-generator

I've installed with this
Code:
composer require picqer/php-barcode-generator

Then I use with
Code:
use Picqer\Barcode;
use Picqer\Barcode\BarcodeGeneratorPNG;

But when I try to use it, CodeIgniter does not find it
Code:
$generator = new Picqer\Barcode\BarcodeGeneratorPNG();
Class 'App\Controllers\Picqer\Barcode\BarcodeGeneratorPNG' not found

I've checked the "vendor/composer/autoload_psr4.php" file to see the namespaces.

Any suggestions ?

Thanks a lot
Reply


Messages In This Thread
Trying to use a barcode library with Composer and CI4 - by kabeza - 06-25-2020, 05:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB