getContainer()->get('folders')->routes; $files = new DirectoryIterator($folder); foreach ($files as $file) { if ($file->isDir() or $file->getExtension() != 'php') { continue; } include_once $file->getRealPath(); }