Skip to content

Commit 3d5592f

Browse files
authored
Merge pull request #9 from alitelli/master
Quickly set QR size
2 parents ec6bfc8 + 9b75681 commit 3d5592f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

QRCode.class.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,12 @@ public function get($iSize = 150, $sECLevel = 'L', $iMargin = 1)
338338
/**
339339
* The HTML code for displaying the QR Code.
340340
*
341+
* @param integer $iSize Default 150
341342
* @return void
342343
*/
343-
public function display()
344+
public function display( $iSize = 150)
344345
{
345-
echo '<p class="center"><img src="' . $this->_cleanUrl($this->get()) . '" alt="QR Code" /></p>';
346+
echo '<p class="center"><img src="' . $this->_cleanUrl($this->get($iSize)) . '" alt="QR Code" /></p>';
346347
}
347348

348349
/**

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ $oQRC->fullName('Pierre-Henry Soria') // Add Full Name
5757
->finish(); // End vCard
5858

5959
// echo '<p><img src="' . $oQRC->get(300) . '" alt="QR Code" /></p>'; // Generate and display the QR Code
60-
$oQRC->display(); // Display
60+
$oQRC->display(300); // Set size and display QR Code default 150px
6161
```
6262

6363
You also have a sample file here: http://github.com/pH-7/QRCode-Generator-PHP-Class/blob/master/example.php

0 commit comments

Comments
 (0)