mirror of
https://github.com/24eme/signaturepdf
synced 2024-06-10 09:52:16 +02:00
route for getting nb layers
This commit is contained in:
parent
12ad0806da
commit
cf41808878
13
app.php
13
app.php
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue