Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get version of generated qr-code #17

Closed
maisen20 opened this issue Apr 16, 2018 · 4 comments
Closed

Get version of generated qr-code #17

maisen20 opened this issue Apr 16, 2018 · 4 comments

Comments

@maisen20
Copy link

first: thank you for this excellent script!

is there a function to get the qr-version of the generated qr-code when in options "version" is set to QRCode::VERSION_AUTO ?

@codemasher
Copy link
Member

codemasher commented Apr 16, 2018

Hey, you're welcome! Did you try QRMatrix::version()? The matrix object holds the version number of the generated qr code and you can get hold of it if you render the code manually like so:

// get the matrix object
$matrix = $qrcode->getMatrix($data);
// fetch the version number
$version = $matrix->version();
// continue render
(new QRImage($qrOptions, $matrix))->dump();

Hope that helps!

@maisen20
Copy link
Author

okay thank you very much :)!

@codemasher
Copy link
Member

codemasher commented Apr 16, 2018

i just realized that the dump() method is on the QROutputInterface but i think you'll get that managed :D

@codemasher
Copy link
Member

fixed the above comments - today's not my day...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants