Tpl::static_directories(): add $details parameter

This commit is contained in:
Benjamin Renard 2024-10-05 18:06:45 +02:00
parent 5d018045c8
commit bf4a208ee8
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -745,9 +745,13 @@ class Tpl {
/**
* Get the static directories path
* @return array<string>
* @param bool $details If true, return a array with root URL as keys and a list of associated
* directory paths as values (optional, default: false)
* @return ($details is true ? array<string,array<string>> : array<string>)
*/
public static function static_directories() {
public static function static_directories($details=false) {
if ($details)
return self :: $static_directories;
$result = array();
foreach(self :: $static_directories as $root_url => $dirs)
foreach(array_keys($dirs) as $dir)