@@ -264,13 +264,25 @@ class MyCustomOptions extends QROptions{
264264}
265265```
266266
267- Invoke a fresh custom ` QROutputInterface ` , see also ` QRCode::initOutputInterface() ` .
267+ You can then call ` QRCode ` with the custom modules.. .
268268``` php
269- $qrOutputInterface = new MyCustomOutput($myCustomOptions, (new QRCode($myCustomOptions))->getMatrix($data));
269+ $myCustomOptions = new MyCustomOptions([
270+ 'version' => 5,
271+ 'eccLevel' => QRCode::ECC_L,
272+ 'outputType' => QRCode::OUTPUT_CUSTOM,
273+ 'outputInterface' => MyCustomOutput::class,
274+ // custom settings
275+ 'myParam' => 'whatever value',
276+ ]);
277+
278+ (new QRCode($myCustomOptions))->render($data);
270279```
271280
272- ...and dump the output, which is equivalent to ` QRCode::render() `
281+ ...or you can invoke the ` QROutputInterface ` manually.
273282``` php
283+ $qrOutputInterface = new MyCustomOutput($myCustomOptions, (new QRCode($myCustomOptions))->getMatrix($data));
284+
285+ //dump the output, which is equivalent to QRCode::render()
274286$qrOutputInterface->dump();
275287```
276288
@@ -296,6 +308,7 @@ name | description
296308` OUTPUT_MARKUP_SVG ` , ` OUTPUT_MARKUP_HTML ` | ` QROptions::$outputType ` markup
297309` OUTPUT_IMAGE_PNG ` , ` OUTPUT_IMAGE_JPG ` , ` OUTPUT_IMAGE_GIF ` | ` QROptions::$outputType ` image
298310` OUTPUT_STRING_JSON ` , ` OUTPUT_STRING_TEXT ` | ` QROptions::$outputType ` string
311+ ` OUTPUT_CUSTOM ` | ` QROptions::$outputType ` , requires ` QROptions::$outputInterface `
299312` ECC_L ` , ` ECC_M ` , ` ECC_Q ` , ` ECC_H ` , | ECC-Level: 7%, 15%, 25%, 30% in ` QROptions::$eccLevel `
300313` DATA_NUMBER ` , ` DATA_ALPHANUM ` , ` DATA_BYTE ` , ` DATA_KANJI ` | ` QRDataInterface::$datamode `
301314
@@ -310,6 +323,7 @@ property | type | default | allowed | description
310323` $addQuietzone ` | bool | true | - | Add a "quiet zone" (margin) according to the QR code spec
311324` $quietzoneSize ` | int | 4 | clamped to 0 ... ` $matrixSize / 2 ` | Size of the quiet zone
312325` $outputType ` | string | ` QRCode::OUTPUT_IMAGE_PNG ` | ` QRCode::OUTPUT_* ` | built-in output type
326+ ` $outputInterface ` | string | null | * | FQCN of the custom ` QROutputInterface ` if ` QROptions::$outputType ` is set to ` QRCode::OUTPUT_CUSTOM `
313327` $cachefile ` | string | null | * | optional cache file path
314328` $eol ` | string | ` PHP_EOL ` | * | newline string (HTML, SVG, TEXT)
315329` $scale ` | int | 5 | * | size of a QR code pixel (SVG, IMAGE_ * ), HTML -> via CSS
0 commit comments