1
0
Fork 0
mirror of https://github.com/24eme/signaturepdf synced 2024-05-19 14:16:37 +02:00

route for getting nb layers

This commit is contained in:
Jb Lm 2022-04-01 15:43:24 +02:00
parent 12ad0806da
commit cf41808878

13
app.php
View file

@ -313,4 +313,17 @@ $f3->route('POST /signature/@hash/save',
}
);
$f3->route('GET /signature/@hash/nblayers',
function($f3) {
$files = scandir($f3->get('STORAGE').$f3->get('PARAMS.hash'));
$nbLayers = 0;
foreach($files as $file) {
if(strpos($file, 'svg.pdf') !== false) {
$nbLayers++;
}
}
echo $nbLayers;
}
);
return $f3;