You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-25Lines changed: 24 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,30 +122,6 @@ foreach($matrix->matrix() as $y => $row){
122
122
}
123
123
```
124
124
125
-
#### Authenticator trait
126
-
This library includes [codemasher/php-authenticator](https://github.com/codemasher/php-authenticator) to create `otpauth://` QR Codes for use with mobile authenticators, all in a single trait:
127
-
```php
128
-
use chillerlan\QRCode\{QRCode, QROptions, Traits\QRAuthenticator};
129
-
130
-
class MyAuthenticatorClass{
131
-
use QRAuthenticator;
132
-
133
-
public function getQRCode(){
134
-
135
-
// data fetched from wherever
136
-
$this->authenticatorSecret = 'SECRETTEST234567';
137
-
$label = 'my label';
138
-
$issuer = 'example.com';
139
-
140
-
// set QROptions options if needed
141
-
$this->qrOptions = new QROptions(['outputType' => QRCode::OUTPUT_MARKUP_SVG]);
142
-
143
-
return $this->getURIQRCode($label, $issuer);
144
-
}
145
-
146
-
}
147
-
```
148
-
149
125
Have a look [in this folder](https://github.com/codemasher/php-qrcode/tree/master/examples) for some more usage examples.
150
126
151
127
#### Custom module values
@@ -218,7 +194,6 @@ $options->moduleValues = [
218
194
219
195
Combined with a custom output interface and your imagination you can create some cool effects that way!
220
196
221
-
222
197
#### Custom `QROutputInterface`
223
198
Instead of bloating your code you can simply create your own output interface by extending `QROutputAbstract`. Have a look at the [built-in output modules](https://github.com/codemasher/php-qrcode/tree/master/src/Output).
224
199
@@ -286,6 +261,30 @@ $qrOutputInterface = new MyCustomOutput($myCustomOptions, (new QRCode($myCustomO
286
261
$qrOutputInterface->dump();
287
262
```
288
263
264
+
#### Authenticator trait
265
+
This library includes [codemasher/php-authenticator](https://github.com/codemasher/php-authenticator) to create `otpauth://` QR Codes for use with mobile authenticators, all in a single trait:
266
+
```php
267
+
use chillerlan\QRCode\{QRCode, QROptions, Traits\QRAuthenticator};
268
+
269
+
class MyAuthenticatorClass{
270
+
use QRAuthenticator;
271
+
272
+
public function getQRCode(){
273
+
274
+
// data fetched from wherever
275
+
$this->authenticatorSecret = 'SECRETTEST234567';
276
+
$label = 'my label';
277
+
$issuer = 'example.com';
278
+
279
+
// set QROptions options if needed
280
+
$this->qrOptions = new QROptions(['outputType' => QRCode::OUTPUT_MARKUP_SVG]);
0 commit comments