PHP Class Endroid\QrCode\QrCode

Afficher le fichier Open project: endroid/qrcode Class Usage Examples

Protected Properties

Свойство 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

Méthodes publiques

Méthode 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 méthode

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

create() public méthode

Create the image.
public create ( )

get() public méthode

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

getBackgroundColor() public méthode

Return background color of the QR Code.
public getBackgroundColor ( ) : array
Résultat array

getContentType() public méthode

Returns the content type corresponding to the image type.
public getContentType ( ) : string
Résultat string

getDataUri() public méthode

Return the data URI.
public getDataUri ( ) : string
Résultat string

getDrawBorder() public méthode

Return draw border around QR Code.
public getDrawBorder ( ) : boolean
Résultat boolean

getDrawQuietZone() public méthode

Return draw required four-module wide margin.
public getDrawQuietZone ( ) : boolean
Résultat boolean

getErrorCorrection() public méthode

Return QR Code error correction level.
public getErrorCorrection ( ) : integer
Résultat integer

getForegroundColor() public méthode

Return foreground color of the QR Code.
public getForegroundColor ( ) : array
Résultat array

getImage() public méthode

Return the image resource.
public getImage ( ) : resource
Résultat resource

getImagePath() public méthode

Return path to the images directory.
public getImagePath ( ) : string
Résultat string

getImageType() public méthode

Return image type for rendering.
public getImageType ( ) : string
Résultat string

getLabel() public méthode

Return QR Code label (text).
public getLabel ( ) : string
Résultat string

getLabelFontPath() public méthode

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

getLabelFontSize() public méthode

Return QR Code label font size.
public getLabelFontSize ( ) : integer
Résultat integer

getLabelHalign() public méthode

Return label horizontal alignment.
public getLabelHalign ( ) : integer
Résultat integer

getLabelValign() public méthode

Return label vertical alignment.
public getLabelValign ( ) : integer
Résultat integer

getModuleSize() public méthode

Return QR Code module size.
public getModuleSize ( ) : integer
Résultat integer

getPadding() public méthode

Return padding around the QR Code.
public getPadding ( ) : integer
Résultat integer

getPath() public méthode

Return path to the data directory.
public getPath ( ) : string
Résultat string

getSize() public méthode

Return QR Code size (width).
public getSize ( ) : integer
Résultat integer

getText() public méthode

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

getVersion() public méthode

Return QR Code version.
public getVersion ( ) : integer
Résultat integer

render() public méthode

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)
Résultat QrCode

save() public méthode

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

setBackgroundColor() public méthode

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

setDrawBorder() public méthode

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

setDrawQuietZone() public méthode

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
Résultat QrCode

setErrorCorrection() public méthode

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

setExtension() public méthode

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

setForegroundColor() public méthode

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

setImagePath() public méthode

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

setImageType() public méthode

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

setLabel() public méthode

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

setLabelFontPath() public méthode

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
Résultat QrCode

setLabelFontSize() public méthode

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

setLabelHalign() public méthode

Set label horizontal alignment.
public setLabelHalign ( integer $label_halign ) : QrCode
$label_halign integer Label horizontal alignment
Résultat QrCode

setLabelValign() public méthode

Set label vertical alignment.
public setLabelValign ( integer $label_valign ) : QrCode
$label_valign integer Label vertical alignment
Résultat QrCode

setLogoSize() public méthode

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

setModuleSize() public méthode

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

setPadding() public méthode

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

setPath() public méthode

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

setSize() public méthode

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

setStructureAppend() public méthode

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
Résultat QrCode

setText() public méthode

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

setVersion() public méthode

Set QR Code version.
public setVersion ( integer $version ) : QrCode
$version integer QR Code version
Résultat QrCode

Property Details

$color_background protected_oe property

protected array $color_background
Résultat array

$color_foreground protected_oe property

protected array $color_foreground
Résultat array

$draw_border protected_oe property

protected bool $draw_border
Résultat boolean

$draw_quiet_zone protected_oe property

protected bool $draw_quiet_zone
Résultat boolean

$error_correction protected_oe property

protected int $error_correction
Résultat integer

$error_corrections_available protected_oe property

protected array $error_corrections_available
Résultat array

$image protected_oe property

protected resource $image
Résultat resource

$image_path protected_oe property

protected string $image_path
Résultat string

$image_type protected_oe property

protected string $image_type
Résultat string

$image_types_available protected_oe property

protected array $image_types_available
Résultat array

$label protected_oe property

protected string $label
Résultat string

$label_font_path protected_oe property

protected string $label_font_path
Résultat string

$label_font_size protected_oe property

protected int $label_font_size
Résultat integer

$label_halign protected_oe property

protected int $label_halign
Résultat integer

$label_valign protected_oe property

protected int $label_valign
Résultat integer

$logo_size protected_oe property

protected $logo_size

$module_size protected_oe property

protected int $module_size
Résultat integer

$padding protected_oe property

protected int $padding
Résultat integer

$path protected_oe property

protected string $path
Résultat string

$size protected_oe property

protected int $size
Résultat integer

$structure_append_m protected_oe property

protected int $structure_append_m
Résultat integer

$structure_append_n protected_oe property

protected int $structure_append_n
Résultat integer

$structure_append_original_data protected_oe property

protected string $structure_append_original_data
Résultat string

$structure_append_parity protected_oe property

protected int $structure_append_parity
Résultat integer

$text protected_oe property

protected string $text
Résultat string

$version protected_oe property

protected int $version
Résultat integer