- Dependencies:
QrCode
{
"require": {
"gonzalo123/qrserviceprovider": "dev-master"
}
}
use Silex\Application;
use G\QrServiceProvider;
$app = new Application();
$app->register(new QrServiceProvider(), [
'qr.defaults' => [
'padding' => 5, // default: 0
'size' => 200,
'imageType' => 'png', // png, gif, jpeg, wbmp (default: png)
]
]);
$app->get("/qr/base64/{text}", function($text) use ($app) {
return $app['qrCode'](base64_decode($text))->getResponse();
});
$app->get("/qr/{text}", function($text) use ($app) {
return $app['qrCode']($text)->getResponse();
});
$app->run();