Endroid\QrCode\QrCode::setLogo PHP Method

    public function setLogo($logo)
    {
        if (!file_exists($logo)) {
            throw new DataDoesntExistsException("{$logo} file does not exist");
        }
        $this->logo = $logo;
        return $this;
    }

Usage Example

コード例 #1
0
 protected function createQrCode(MediaInterface $media)
 {
     $path = tempnam(sys_get_temp_dir(), 'sonata_media_qrcode_reference') . '.' . $this->config['extension'];
     $qrCode = new QrCode();
     $qrCode->setText($media->getBinaryContent())->setSize($this->config['size'])->setPadding($this->config['padding'])->setErrorCorrection($this->config['error_correction'])->setForegroundColor($this->config['foreground'])->setBackgroundColor($this->config['background'])->setLabel($this->config['label'])->setLabelFontSize($this->config['label_size'])->setImageType($this->config['extension']);
     if ($this->config['logo'] && is_file($this->config['logo'])) {
         $qrCode->setLogo($this->config['logo']);
     }
     $qrCode->save($path);
     return $path;
 }
All Usage Examples Of Endroid\QrCode\QrCode::setLogo