Blame view

src/Controller/QrCodesController.php 486 Bytes
5d0d680d   Alexandre   Version: 2.2.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
namespace App\Controller;

use App\Controller\AppController;
use QRcode;

class QrCodesController extends AppController
{
	
	public function creer($message) {
		
			$fileName = $this->request->session()->id().'.png';
			$cakephpPath = str_replace('webroot/index.php', '', $_SERVER['SCRIPT_FILENAME']);
			$qrCodePath = $cakephpPath . 'webroot/img/' . $fileName;
			
	
			$this->request->session()->write('filename', $fileName);
			return QRcode::png($message, $qrCodePath);
	}
	
}