added filenameToTitle

This commit is contained in:
2024-04-23 10:20:55 +10:00
parent 0a99b1789b
commit d6b03826c1

View File

@@ -170,4 +170,12 @@ class Helpers
return $name;
}
public static function filenameToTitle(string $filename): string
{
$title = pathinfo($filename, PATHINFO_FILENAME);
$title = str_replace(['-', '_', '.'], ' ', $title);
$title = ucwords($title);
return $title;
}
}