Writer
in package
QR code writer.
Table of Contents
- $renderer : RendererInterface
- Renderer instance.
- __construct() : mixed
- Creates a new writer with a specific renderer.
- writeFile() : void
- Writes QR code to a file.
- writeString() : string
- Writes QR code and returns it as string.
Properties
$renderer
Renderer instance.
private
RendererInterface
$renderer
Methods
__construct()
Creates a new writer with a specific renderer.
public
__construct(RendererInterface $renderer) : mixed
Parameters
- $renderer : RendererInterface
Return values
mixed —writeFile()
Writes QR code to a file.
public
writeFile(string $content, string $filename[, string $encoding = Encoder::DEFAULT_BYTE_MODE_ECODING ][, ErrorCorrectionLevel|null $ecLevel = null ][, Version|null $forcedVersion = null ]) : void
Parameters
- $content : string
- $filename : string
- $encoding : string = Encoder::DEFAULT_BYTE_MODE_ECODING
- $ecLevel : ErrorCorrectionLevel|null = null
- $forcedVersion : Version|null = null
Tags
Return values
void —writeString()
Writes QR code and returns it as string.
public
writeString(string $content[, string $encoding = Encoder::DEFAULT_BYTE_MODE_ECODING ][, ErrorCorrectionLevel|null $ecLevel = null ][, Version|null $forcedVersion = null ]) : string
Content is a string which should be encoded in UTF-8, in case there are non ASCII-characters present.
Parameters
- $content : string
- $encoding : string = Encoder::DEFAULT_BYTE_MODE_ECODING
- $ecLevel : ErrorCorrectionLevel|null = null
- $forcedVersion : Version|null = null