Welcome Guest, Not a member yet? Register   Sign In
Call file / class from ThirdParty folder
#5
Thumbs Up 

(11-25-2019, 09:43 AM)dave friend Wrote:
(11-25-2019, 06:17 AM)StefenKhoe Wrote:
PHP Code:
$psr4 = [
 ...
 ...
 ...
 
'TP\Tools' => APPPATH 'ThirdParty/Foo.php'
 
]; 

The part shown above is not correct. The value should be a path to a folder - NOT to a file.

While trying to reproduce your problem here is what worked for me. Both
/app/ThirdParty/Foo.php and app/Controllers/User.php remain as you show in the OP. In fact, the only change is to what @MGatner did in /app/Config/Autoload.php. Here what I tried and it works.

PHP Code:
$psr4 = [
    
'Config'      => APPPATH 'Config',
    
APP_NAMESPACE => APPPATH,                // For custom namespace
    
'App'         => APPPATH,                // To ensure filters, etc still found,
    
'TP\Tools'    => APPPATH 'ThirdParty',
]; 

@Dave : super thankyou !, work for me too..
Reply


Messages In This Thread
RE: Call file / class from ThirdParty folder - by StefenKhoe - 11-29-2019, 07:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB