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:
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 New Issue
Block a user