PHP Class Endroid\QrCode\QrCode

ファイルを表示 Open project: endroid/qrcode Class Usage Examples

Protected Properties

Property Type Description
$color_background array
$color_foreground array
$draw_border boolean
$draw_quiet_zone boolean
$error_correction integer
$error_corrections_available array
$image resource
$image_path string
$image_type string
$image_types_available array
$label string
$label_font_path string
$label_font_size integer
$label_halign integer
$label_valign integer
$logo string
$logo_size
$module_size integer
$padding integer
$path string
$size integer
$structure_append_m integer
$structure_append_n integer
$structure_append_original_data string
$structure_append_parity integer
$text string
$version integer

Public Methods

Method Description
__construct ( string $text = '' ) Class constructor.
create ( ) Create the image.
get ( string | null $format = null ) : string Create QR Code and return its content.
getBackgroundColor ( ) : array Return background color of the QR Code.
getContentType ( ) : string Returns the content type corresponding to the image type.
getDataUri ( ) : string Return the data URI.
getDrawBorder ( ) : boolean Return draw border around QR Code.
getDrawQuietZone ( ) : boolean Return draw required four-module wide margin.
getErrorCorrection ( ) : integer Return QR Code error correction level.
getForegroundColor ( ) : array Return foreground color of the QR Code.
getImage ( ) : resource Return the image resource.
getImagePath ( ) : string Return path to the images directory.
getImageType ( ) : string Return image type for rendering.
getLabel ( ) : string Return QR Code label (text).
getLabelFontPath ( ) : string Return path to the QR Code label's TTF font file.
getLabelFontSize ( ) : integer Return QR Code label font size.
getLabelHalign ( ) : integer Return label horizontal alignment.
getLabelValign ( ) : integer Return label vertical alignment.
getModuleSize ( ) : integer Return QR Code module size.
getPadding ( ) : integer Return padding around the QR Code.
getPath ( ) : string Return path to the data directory.
getSize ( ) : integer Return QR Code size (width).
getText ( ) : string Return text that will be hid in QR Code.
getVersion ( ) : integer Return QR Code version.
render ( null | string $filename = null, null | string $format = 'png' ) : QrCode Render the QR Code then save it to given file name or output it to the browser when file name omitted.
save ( string $filename ) : QrCode Render the QR Code then save it to given file name.
setBackgroundColor ( array $color_background ) : QrCode Set background color of the QR Code.
setDrawBorder ( boolean $draw_border ) : QrCode Set draw border around QR Code.
setDrawQuietZone ( boolean $draw_quiet_zone ) : QrCode Set draw required four-module wide margin.
setErrorCorrection ( mixed $error_correction ) : QrCode Set QR Code error correction level.
setExtension ( string $extension ) : QrCode Set image type for rendering via extension.
setForegroundColor ( array $color_foreground ) : QrCode Set foreground color of the QR Code.
setImagePath ( string $image_path ) : QrCode Set path to the images directory.
setImageType ( string $image_type ) : QrCode Set image type for rendering.
setLabel ( integer | string $label ) : QrCode Set QR Code label (text).
setLabelFontPath ( integer $label_font_path ) : QrCode Set QR Code label font path.
setLabelFontSize ( integer $label_font_size ) : QrCode Set QR Code label font size.
setLabelHalign ( integer $label_halign ) : QrCode Set label horizontal alignment.
setLabelValign ( integer $label_valign ) : QrCode Set label vertical alignment.
setLogo ( string $logo ) : QrCode Set logo in QR Code.
setLogoSize ( integer $logo_size ) : QrCode Set logo size in QR Code(default 48).
setModuleSize ( integer $module_size ) : QrCode Set QR Code module size.
setPadding ( integer $padding ) : QrCode Set padding around the QR Code.
setPath ( string $path ) : QrCode Set path to the data directory.
setSize ( integer $size ) : QrCode Set QR Code size (width).
setStructureAppend ( integer $n, integer $m, integer $parity, string $original_data ) : QrCode Set structure append.
setText ( string $text ) : QrCode Set text to hide in QR Code.
setVersion ( integer $version ) : QrCode Set QR Code version.

Method Details

__construct() public method

Class constructor.
public __construct ( string $text = '' )
$text string

create() public method

Create the image.
public create ( )

get() public method

Create QR Code and return its content.
public get ( string | null $format = null ) : string
$format string | null Image type (gif, png, wbmp, jpeg)
return string

getBackgroundColor() public method

Return background color of the QR Code.
public getBackgroundColor ( ) : array
return array

getContentType() public method

Returns the content type corresponding to the image type.
public getContentType ( ) : string
return string

getDataUri() public method

Return the data URI.
public getDataUri ( ) : string
return string

getDrawBorder() public method

Return draw border around QR Code.
public getDrawBorder ( ) : boolean
return boolean

getDrawQuietZone() public method

Return draw required four-module wide margin.
public getDrawQuietZone ( ) : boolean
return boolean

getErrorCorrection() public method

Return QR Code error correction level.
public getErrorCorrection ( ) : integer
return integer

getForegroundColor() public method

Return foreground color of the QR Code.
public getForegroundColor ( ) : array
return array

getImage() public method

Return the image resource.
public getImage ( ) : resource
return resource

getImagePath() public method

Return path to the images directory.
public getImagePath ( ) : string
return string

getImageType() public method

Return image type for rendering.
public getImageType ( ) : string
return string

getLabel() public method

Return QR Code label (text).
public getLabel ( ) : string
return string

getLabelFontPath() public method

Return path to the QR Code label's TTF font file.
public getLabelFontPath ( ) : string
return string

getLabelFontSize() public method

Return QR Code label font size.
public getLabelFontSize ( ) : integer
return integer

getLabelHalign() public method

Return label horizontal alignment.
public getLabelHalign ( ) : integer
return integer

getLabelValign() public method

Return label vertical alignment.
public getLabelValign ( ) : integer
return integer

getModuleSize() public method

Return QR Code module size.
public getModuleSize ( ) : integer
return integer

getPadding() public method

Return padding around the QR Code.
public getPadding ( ) : integer
return integer

getPath() public method

Return path to the data directory.
public getPath ( ) : string
return string

getSize() public method

Return QR Code size (width).
public getSize ( ) : integer
return integer

getText() public method

Return text that will be hid in QR Code.
public getText ( ) : string
return string

getVersion() public method

Return QR Code version.
public getVersion ( ) : integer
return integer

render() public method

Render the QR Code then save it to given file name or output it to the browser when file name omitted.
public render ( null | string $filename = null, null | string $format = 'png' ) : QrCode
$filename null | string File name of the QR Code
$format null | string Format of the file (png, jpeg, jpg, gif, wbmp)
return QrCode

save() public method

Render the QR Code then save it to given file name.
public save ( string $filename ) : QrCode
$filename string File name of the QR Code
return QrCode

setBackgroundColor() public method

Set background color of the QR Code.
public setBackgroundColor ( array $color_background ) : QrCode
$color_background array RGB color
return QrCode

setDrawBorder() public method

Set draw border around QR Code.
public setDrawBorder ( boolean $draw_border ) : QrCode
$draw_border boolean State of border drawing
return QrCode

setDrawQuietZone() public method

Set draw required four-module wide margin.
public setDrawQuietZone ( boolean $draw_quiet_zone ) : QrCode
$draw_quiet_zone boolean State of required four-module wide margin drawing
return QrCode

setErrorCorrection() public method

Set QR Code error correction level.
public setErrorCorrection ( mixed $error_correction ) : QrCode
$error_correction mixed Error Correction Level
return QrCode

setExtension() public method

Set image type for rendering via extension.
public setExtension ( string $extension ) : QrCode
$extension string Image extension
return QrCode

setForegroundColor() public method

Set foreground color of the QR Code.
public setForegroundColor ( array $color_foreground ) : QrCode
$color_foreground array RGB color
return QrCode

setImagePath() public method

Set path to the images directory.
public setImagePath ( string $image_path ) : QrCode
$image_path string Image directory
return QrCode

setImageType() public method

Set image type for rendering.
public setImageType ( string $image_type ) : QrCode
$image_type string Image type
return QrCode

setLabel() public method

Set QR Code label (text).
public setLabel ( integer | string $label ) : QrCode
$label integer | string Label to print under QR code
return QrCode

setLabelFontPath() public method

Set QR Code label font path.
public setLabelFontPath ( integer $label_font_path ) : QrCode
$label_font_path integer Path to the QR Code label's TTF font file
return QrCode

setLabelFontSize() public method

Set QR Code label font size.
public setLabelFontSize ( integer $label_font_size ) : QrCode
$label_font_size integer Font size of the QR code label
return QrCode

setLabelHalign() public method

Set label horizontal alignment.
public setLabelHalign ( integer $label_halign ) : QrCode
$label_halign integer Label horizontal alignment
return QrCode

setLabelValign() public method

Set label vertical alignment.
public setLabelValign ( integer $label_valign ) : QrCode
$label_valign integer Label vertical alignment
return QrCode

setLogoSize() public method

Set logo size in QR Code(default 48).
public setLogoSize ( integer $logo_size ) : QrCode
$logo_size integer Logo Size
return QrCode

setModuleSize() public method

Set QR Code module size.
public setModuleSize ( integer $module_size ) : QrCode
$module_size integer Module size
return QrCode

setPadding() public method

Set padding around the QR Code.
public setPadding ( integer $padding ) : QrCode
$padding integer Padding around QR Code
return QrCode

setPath() public method

Set path to the data directory.
public setPath ( string $path ) : QrCode
$path string Data directory
return QrCode

setSize() public method

Set QR Code size (width).
public setSize ( integer $size ) : QrCode
$size integer Width of the QR Code
return QrCode

setStructureAppend() public method

Set structure append.
public setStructureAppend ( integer $n, integer $m, integer $parity, string $original_data ) : QrCode
$n integer
$m integer
$parity integer Parity
$original_data string Original data
return QrCode

setText() public method

Set text to hide in QR Code.
public setText ( string $text ) : QrCode
$text string Text to hide
return QrCode

setVersion() public method

Set QR Code version.
public setVersion ( integer $version ) : QrCode
$version integer QR Code version
return QrCode

Property Details

$color_background protected_oe property

protected array $color_background
return array

$color_foreground protected_oe property

protected array $color_foreground
return array

$draw_border protected_oe property

protected bool $draw_border
return boolean

$draw_quiet_zone protected_oe property

protected bool $draw_quiet_zone
return boolean

$error_correction protected_oe property

protected int $error_correction
return integer

$error_corrections_available protected_oe property

protected array $error_corrections_available
return array

$image protected_oe property

protected resource $image
return resource

$image_path protected_oe property

protected string $image_path
return string

$image_type protected_oe property

protected string $image_type
return string

$image_types_available protected_oe property

protected array $image_types_available
return array

$label protected_oe property

protected string $label
return string

$label_font_path protected_oe property

protected string $label_font_path
return string

$label_font_size protected_oe property

protected int $label_font_size
return integer

$label_halign protected_oe property

protected int $label_halign
return integer

$label_valign protected_oe property

protected int $label_valign
return integer

$logo_size protected_oe property

protected $logo_size

$module_size protected_oe property

protected int $module_size
return integer

$padding protected_oe property

protected int $padding
return integer

$path protected_oe property

protected string $path
return string

$size protected_oe property

protected int $size
return integer

$structure_append_m protected_oe property

protected int $structure_append_m
return integer

$structure_append_n protected_oe property

protected int $structure_append_n
return integer

$structure_append_original_data protected_oe property

protected string $structure_append_original_data
return string

$structure_append_parity protected_oe property

protected int $structure_append_parity
return integer

$text protected_oe property

protected string $text
return string

$version protected_oe property

protected int $version
return integer