การสร้าง Barcode ใน Yii Framework

ใน Yii Framework มี Extension เสริมที่จะช่วยให้เราสร้าง Barcode ได้นั่นก็คือ Barcode-Generator โดยสามารถดาวโหลดได้ที่ Barcode Generator
วิธีการใช้งาน
- นำไปวางไว้ใน protected/extensions/barcode
- เขียนคำสั่งในการสร้าง Barcode
//Widht of the barcode image.
$width = 284;
//Height of the barcode image.
$height = 184;
//Quality of the barcode image. Only for JPEG.
$quality = 100;
//1 if text should appear below the barcode. Otherwise 0.
$text =1;
// Location of barcode image storage.
$location = Yii::getPathOfAlias("webroot").'/bc';
Yii::import("application.extensions.barcode.*");
barcode::Barcode39('some text', $width , $height , $quality, $text, $location);
ตัวอย่าง
ความคิดเห็น (0)
ยังไม่มีความคิดเห็น — เริ่มคุยเป็นคนแรก ถามสิ่งที่สงสัย หรือแชร์ประสบการณ์ของคุณ
เข้าสู่ระบบเพื่อร่วมแสดงความคิดเห็น
เข้าสู่ระบบ