Welcome Guest, Not a member yet? Register   Sign In
how to load qr library
#1

(This post was last modified: 07-10-2020, 11:57 PM by jreklund.)

I am trying to use in my controller a library that generates qr code, however I don't know how to call libraries in codeigniter 4

I tried different ways how usar App \ Libraries \ ciqrcode; or as indicated by github


Code:
$this->load->library('ciqrcode');

header("Content-Type: image/png");
$params['data'] = 'This is a text to encode become QR Code';
$this->ciqrcode->generate($params);

however it generates the following error

Code:
"Undefined property: App\\Controllers\\Api_sistem::$ciqrcode",
Reply
#2

(This post was last modified: 07-11-2020, 12:01 AM by jreklund.)

Hi, that one are tailored for CodeIgniter 3, and will not work outside the box. There are no need to search for specifics packages anymore for CodeIgniter, just use a generic one that can be installed and used with Composer.

Like this one: https://github.com/endroid/qr-code

PS. I deleted all your x-large text, no one likes that. It's just irritating.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB