getModuleList() as $name => $extension) { $namespaces[$name] = $extension->getPath(); } foreach ($theme_handler->listInfo() as $name => $extension) { $namespaces[$name] = $extension->getPath(); } foreach ($namespaces as $name => $path) { $this->addPath($path . '/templates', $name); } } /** * Adds a path where templates are stored. * * @param string $path * A path where to look for templates. * @param string $namespace * (optional) A path name. */ public function addPath($path, $namespace = self::MAIN_NAMESPACE) { // Invalidate the cache. $this->cache = []; $this->paths[$namespace][] = rtrim($path, '/\\'); } }