![]() |
Shippo LIbrary Integration - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: Shippo LIbrary Integration (/showthread.php?tid=78521) |
Shippo LIbrary Integration - shelbyblanton - 02-02-2021 I am attempting to integrate Shippo's PHP library (https://github.com/goshippo/shippo-php-client) into CodeIgniter4. I have installed the library via composer and as such CI4's autoloader should be autoloading the library. In looking at my composer.lock file I see that Shippo does not have PSR4 namespacing and is only loaded as a classmap: Code: "autoload": { In the CI4 BaseController I have called the class and set the API Key as outlined in the library: Code: use Shippo; And then in my Shipments controller I test the function as outlined in the library readme: Code: use Shippo; I always get an error "Error - Class 'App\Controllers\Shippo_Shipment' not found" and this line highlighted: Code: $shipment = Shippo_Shipment::create( I am assuming this is a namespacing issue, but I cannot figure out the specifics as I am only 3 apps into using CI4. Any suggestions? RE: Shippo LIbrary Integration - iRedds - 02-02-2021 "use Shippo_Shipment" instead of "use Shippo" in the controller RE: Shippo LIbrary Integration - shelbyblanton - 02-02-2021 THANK YOU! That did it. I apologize if this is an elementary mistake! |