Tpl::static_directories(): add $details parameter

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

View file

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