public function test($url) { foreach ($this->pattern as $key => $pattern) { if (route::compare_url_to_pattern($url, $pattern)) { if (array_key_exists($key, $this->patternFiles)) { $toLoad = $this->patternFiles[$key]; foreach ($toLoad as $file) { $this->files[] = $file; // we add the files } } $filesBefore = $this->load_linked_before(); $filesAfter = $this->load_linked_after(); $files = array($this->module => $this->files); $GLOBALS['modules_loaded'][$this->module] = array(); // the array contains the modules linked return array_merge($filesBefore, $files, $filesAfter); // returning an array containing the files to load } } return false; }