Welcome Guest, Not a member yet? Register   Sign In
How to use Minify in Codeigniter 4 - Namespace Issues
#2

(This post was last modified: 10-20-2020, 05:50 AM by captain-sensible.)

i think it may be your not linking a "namespace" to where classes are using namespace.

Namespace of css.php is "MatthiasMullie\Minify" so you have to use that. the \ is a problem so simply escape that with another backspace.

'MatthiasMullie\\Minify'=>APPPATH.'Libraries/Mathia/src',



i prefer to keep my 3rd packages separate, im using PHPMailer:

Code:
appstarter
├── PHPMailer
├── README.md
├── app
├── builds
├── composer.json
├── composer.lock
├── env
├── fontawesome
├── gulpfile.js
├── license.txt
├── node_modules
├── package-lock.json
├── package.json
├── phpunit.xml.dist
├── public
├── scss
├── spark
├── tests
├── vendor
└── writable


php mailer is at same level as app; to get it working this is my autoload:

Code:
public $psr4 = [
        APP_NAMESPACE => APPPATH, // For custom app namespace
        
        
        'Config'      => APPPATH . 'Config',
         'PHPMailer\\PHPMailer'=> ROOTPATH.'PHPMailer/src',
        
        
    ];

then in a controller to use it :


Code:
use PHPMailer\PHPMailer\PHPMailer;

by the way you can use composer to get that :

https://packagist.org/packages/matthiasmullie/minify

then the autoload feature of composer would do class linking for you automatically
Reply


Messages In This Thread
RE: How to use Minify in Codeigniter 4 - Namespace Issues - by captain-sensible - 10-20-2020, 05:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB