/** * Generate a QR code image * * @return bool True if image displayed, false on failure. */ protected function fetchQRCode() { if (empty($this->text)) { return false; } $this->contentType = 'image/png'; $this->image = PHPQRCode\QRcode::PNG($this->text, false, $this->params['level'], $this->params['size'], $this->params['margin']); return true; }