1
0
mirror of https://github.com/24eme/signaturepdf.git synced 2023-08-25 09:33:08 +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;