Skip to content

Commit 0929aa0

Browse files
committed
1 parent d7bacdc commit 0929aa0

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

README.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -122,30 +122,6 @@ foreach($matrix->matrix() as $y => $row){
122122
}
123123
```
124124

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-
149125
Have a look [in this folder](https://github.com/codemasher/php-qrcode/tree/master/examples) for some more usage examples.
150126

151127
#### Custom module values
@@ -218,7 +194,6 @@ $options->moduleValues = [
218194

219195
Combined with a custom output interface and your imagination you can create some cool effects that way!
220196

221-
222197
#### Custom `QROutputInterface`
223198
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).
224199

@@ -286,6 +261,30 @@ $qrOutputInterface = new MyCustomOutput($myCustomOptions, (new QRCode($myCustomO
286261
$qrOutputInterface->dump();
287262
```
288263

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]);
281+
282+
return $this->getURIQRCode($label, $issuer);
283+
}
284+
285+
}
286+
```
287+
289288
### API
290289

291290
#### `QRCode` methods

0 commit comments

Comments
 (0)