ข้ามไปยังเนื้อหาหลัก
ProgrammerThailand

บล็อก #yii #barcode

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

ใน Yii Framework มี Extension เสริมที่จะช่วยให้เราสร้าง Barcode ได้นั่นก็คือ Barcode-Generator โดยสามารถดาวโหลดได้ที่ Barcode Generator

วิธีการใช้งาน

  1. นำไปวางไว้ใน protected/extensions/barcode
  2. เขียนคำสั่งในการสร้าง 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);

ตัวอย่าง

เขียนโดย

admin

Software Developer

ความคิดเห็น (0)

ยังไม่มีความคิดเห็น — เริ่มคุยเป็นคนแรก ถามสิ่งที่สงสัย หรือแชร์ประสบการณ์ของคุณ

แชร์

← กลับไปหน้าบล็อก