mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-30 03:58:28 +00:00
:octocat: HTML output: add "class" attribute only when $cssClass is non-empty
This commit is contained in:
@@ -54,7 +54,12 @@ class QRMarkup extends QROutputAbstract{
|
||||
* HTML output
|
||||
*/
|
||||
protected function html():string{
|
||||
$html = '<div class="'.$this->options->cssClass.'">'.$this->options->eol;
|
||||
|
||||
$html = empty($this->options->cssClass)
|
||||
? '<div>'
|
||||
: '<div class="'.$this->options->cssClass.'">';
|
||||
|
||||
$html .= $this->options->eol;
|
||||
|
||||
foreach($this->matrix->matrix() as $row){
|
||||
$html .= '<div>';
|
||||
|
||||
Reference in New Issue
Block a user