PHP Класс SimpleSoftwareIO\QrCode\BaconQrCodeGenerator

Наследование: implements SimpleSoftwareIO\QrCode\QrCodeInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$encoding string Holds the Encoder mode to encode a QrCode.
$errorCorrection BaconQrCode\Common\ErrorCorrectionLevel Holds the QrCode error correction levels. This is stored by using the BaconQrCode ErrorCorrectionLevel class constants.
$imageMerge null | string Holds an image string that will be merged with the QrCode.
$imagePercentage float The percentage that a merged image should take over the source image.
$writer BaconQrCode\Writer Holds the BaconQrCode Writer Object.

Открытые методы

Метод Описание
__call ( $method, $arguments ) Creates a new datatype object and then generates a QrCode.
__construct ( BaconQrCode\Writer $writer = null, BaconQrCode\Renderer\Image\RendererInterface $format = null ) Creates a new QrCodeGenerator with a Writer class and with a SVG renderer set as the default.
backgroundColor ( integer $red, integer $green, integer $blue ) Changes the background color of a QrCode.
color ( integer $red, integer $green, integer $blue ) Changes the foreground color of a QrCode.
encoding ( string $encoding ) Sets the Encoding mode.
errorCorrection ( string $level ) Changes the error correction level of a QrCode.
format ( string $format ) Switches the format of the outputted QrCode or defaults to SVG.
generate ( string $text, null | string $filename = null ) : string | void Generates a QrCode.
margin ( integer $margin ) Creates a margin around the QrCode.
merge ( $filepath, $percentage = 0.2, $absolute = false ) Merges an image with the center of the QrCode.
mergeString ( $content, $percentage = 0.2 ) Merges an image string with the center of the QrCode, does not check for correct format.
size ( integer $pixels ) Changes the size of the QrCode.

Приватные методы

Метод Описание
createClass ( string $method ) : SimpleSoftwareIO\QrCode\DataTypes\DataTypeInterface Creates a new DataType class dynamically.
formatClass ( $method ) : string Formats the method name correctly.

Описание методов

__call() публичный Метод

Creates a new datatype object and then generates a QrCode.
public __call ( $method, $arguments )
$method
$arguments

__construct() публичный Метод

Creates a new QrCodeGenerator with a Writer class and with a SVG renderer set as the default.
public __construct ( BaconQrCode\Writer $writer = null, BaconQrCode\Renderer\Image\RendererInterface $format = null )
$writer BaconQrCode\Writer
$format BaconQrCode\Renderer\Image\RendererInterface

backgroundColor() публичный Метод

Changes the background color of a QrCode.
public backgroundColor ( integer $red, integer $green, integer $blue )
$red integer
$green integer
$blue integer

color() публичный Метод

Changes the foreground color of a QrCode.
public color ( integer $red, integer $green, integer $blue )
$red integer
$green integer
$blue integer

encoding() публичный Метод

Sets the Encoding mode.
public encoding ( string $encoding )
$encoding string

errorCorrection() публичный Метод

Changes the error correction level of a QrCode.
public errorCorrection ( string $level )
$level string Desired error correction level. L = 7% M = 15% Q = 25% H = 30%

format() публичный Метод

Switches the format of the outputted QrCode or defaults to SVG.
public format ( string $format )
$format string The desired format.

generate() публичный Метод

Generates a QrCode.
public generate ( string $text, null | string $filename = null ) : string | void
$text string The text to be converted into a QrCode
$filename null | string The filename and path to save the QrCode file
Результат string | void Returns a QrCode string depending on the format, or saves to a file.

margin() публичный Метод

Creates a margin around the QrCode.
public margin ( integer $margin )
$margin integer The desired margin in pixels around the QrCode

merge() публичный Метод

Merges an image with the center of the QrCode.
public merge ( $filepath, $percentage = 0.2, $absolute = false )
$filepath string The filepath to an image
$percentage float The amount that the merged image should be placed over the qrcode.
$absolute boolean Whether to use an absolute filepath or not.

mergeString() публичный Метод

Merges an image string with the center of the QrCode, does not check for correct format.
public mergeString ( $content, $percentage = 0.2 )
$content string The string contents of an image.
$percentage float The amount that the merged image should be placed over the qrcode.

size() публичный Метод

Changes the size of the QrCode.
public size ( integer $pixels )
$pixels integer The size of the QrCode in pixels

Описание свойств

$encoding защищенное свойство

Holds the Encoder mode to encode a QrCode.
protected string $encoding
Результат string

$errorCorrection защищенное свойство

Holds the QrCode error correction levels. This is stored by using the BaconQrCode ErrorCorrectionLevel class constants.
protected ErrorCorrectionLevel,BaconQrCode\Common $errorCorrection
Результат BaconQrCode\Common\ErrorCorrectionLevel

$imageMerge защищенное свойство

Holds an image string that will be merged with the QrCode.
protected null|string $imageMerge
Результат null | string

$imagePercentage защищенное свойство

The percentage that a merged image should take over the source image.
protected float $imagePercentage
Результат float

$writer защищенное свойство

Holds the BaconQrCode Writer Object.
protected Writer,BaconQrCode $writer
Результат BaconQrCode\Writer