Update favicon-extension.blade.php

This commit is contained in:
Julian Prieber 2023-11-23 15:18:51 +01:00
parent d169987b72
commit 3609d1477a
1 changed files with 13 additions and 9 deletions

View File

@ -1,14 +1,18 @@
<?php
function localIcon($id) {
$directory = base_path("assets/favicon/icons");
$files = scandir($directory);
$pathinfo = "error.error";
foreach($files as $file) {
if (strpos($file, $id.'.') !== false) {
$pathinfo = $id. "." . pathinfo($file, PATHINFO_EXTENSION);
}}
return $pathinfo;
if (!function_exists('localIcon')) {
function localIcon($id)
{
$directory = base_path("assets/favicon/icons");
$files = scandir($directory);
$pathinfo = "error.error";
foreach ($files as $file) {
if (strpos($file, $id . '.') !== false) {
$pathinfo = $id . "." . pathinfo($file, PATHINFO_EXTENSION);
}
}
return $pathinfo;
}
}
?>