method getThumbsPath documentation in bbn\Appui\Medias
If the thumbs files exists for this path it returns an array of the the thumbs filename
function($media, bool $if_exists = true, bool $create = false, bool $delete = false)
{
$res = [];
if (is_string($media)) {
$media = $this->getMedia($media, true);
}
if (!is_array($media)) {
throw new Exception(X::_("The media doesn't exist"));
}
if (!empty($media['is_image']) && $this->fs->exists($media['file'])) {
if ($delete) {
$files = $this->fs->getFiles(dirname($media['file']));
if (count($files) > 1) {
foreach ($files as $f) {
if ($f !== $media['file']) {
$this->fs->delete($f);
}
}
}
}
foreach ($media['thumbs'] as $size) {
if (($result = $this->getThumbPath($media['file'], $size, $if_exists, $create)) !== null) {
$res[] = $result;
}
}
}
return $res;
}
If the thumbs files exists for this path it returns an array of the the thumbs filename BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2023
BBN Solutions