Elgg\Assets\ExternalFiles::getLoadedFiles PHP Method

getLoadedFiles() public method

Get external resource descriptors
public getLoadedFiles ( string $type, string $location ) : array
$type string Type of file: js or css
$location string Page location
return array
    public function getLoadedFiles($type, $location)
    {
        if (isset($GLOBALS['_ELGG']->externals) && isset($GLOBALS['_ELGG']->externals[$type]) && $GLOBALS['_ELGG']->externals[$type] instanceof \ElggPriorityList) {
            $items = $GLOBALS['_ELGG']->externals[$type]->getElements();
            $items = array_filter($items, function ($v) use($location) {
                return $v->loaded == true && $v->location == $location;
            });
            if ($items) {
                array_walk($items, function (&$v, $k) {
                    $v = $v->url;
                });
            }
            return $items;
        }
        return array();
    }