Welcome Guest, Not a member yet? Register   Sign In
Using a thrid party Class in CI4
#1

Hello toghether,

i want to use a third party class in my project to generate qr codes.
There is an old libary "qrlib" which is not namespaced but it works :-)

So I added the class "QRcode" to the $classmap Array in the app/config/autoload.php

PHP Code:
        $classmap = [
            
'QRcode' => APPPATH .'third_party/qrcode/qrlib.php'
        
]; 

My question now.. how can i use it? If I use it in a Controller like

PHP Code:
QRcode::png('blablabla'

I get the error "QRcode" could not be found. I thought it is autoloaded? Also I tried to load it manually $this->load() but this function does not longer exists in CI4 Smile

I think this is a simpe question because its about how to use the autoload of CI4 but I dind't found any information in the manual.

Best regards,
Niklas
Reply


Messages In This Thread
Using a thrid party Class in CI4 - by niklas - 05-05-2020, 01:27 AM
RE: Using a thrid party Class in CI4 - by niklas - 05-11-2020, 07:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB