Use library without namespace |
Hi , i want use this php library :
https://github.com/s2software/fatturapa if i add namespace to FatturaPa.php (renamed ) i have this error : Class 'App\ThirdParty\Fatturapa\DOMDocument' not found this is the error row : 471 $doc = new DOMDocument(); if i load with require_once: require_once (APPPATH.'/ThirdParty/Fatturapa/FatturaPA.php'); folder three: https://imgur.com/KLiuofM.png i have thi error : Class 'App\Controllers\FatturaPA' not found how can i use the library ? 471 $doc = new DO 471 $doc = new DOMDocument();MDocument(); Class 'App\ThirdParty\Fatturapa\DOMDocument' not found Class 'App\ThirdParty\Fatturapa\DOMDocument' not found
Without adding the namespaces.
Or adding the correct namespaces in all files. It seems you need to learn PHP's namespaces and PSR-4 autoloader.
app/Config/Autoload.php
classmap property Don't force the namespace in someone else's library.
PHP internal class is located in global namespace.
See https://www.php.net/manual/en/language.n...llback.php
(01-31-2022, 05:12 PM)iRedds Wrote: app/Config/Autoload.php Removed namespace . In config Autoload : Code: public $classmap = [ same error : https://imgur.com/Xux8b27.png This is my folder three : https://imgur.com/Y886AbM.png |
Welcome Guest, Not a member yet? Register Sign In |