I want to implement a function that can generate barcodes in the system and use a barcode scanner to scan the barcodes to enter and exit the warehouse. I use thinkphp5 for development. I searched a lot of information and took the following steps. 1. Copy the barcode class folder barcode to the extend directory. 2. Add this sentence define('EXTEND_PATH','../extend/'); to the entry file. 3. Add a method to the self-built base.php file in common
< ;?php
namespace app\admin\common;
use Util\data\Sysdb;use think\Session;
##}
// Draw the barcode
Series#$ Drawing = New \ BCGDRAWING ('', $ color_white) if it is based on the above conditions. {
$drawing->drawException($drawException);
}else{
$drawing->setBarcode($code); ;draw();
}
using using using ’ ’s ’ through through ’’s out through through off ‐ through through ‐ over‐‐‐‐‐‐‐ } to // header('Content-Disposition:attachment; filename="barcode.png"'); //Automatic download
$drawing->finish(\BCGDrawing::IMG_FORMAT_PNG);
}
Did I write it correctly? What to do next?