/** * Get content in template file * Using name of the host search template file. * * @param $hostName * * @return string */ protected function getTemplateContent($hostName) { $files = $this->filesystem->files($this->templateDir); $content = ''; array_walk($files, function ($file) use($hostName, &$content) { if (preg_match('/' . $hostName . '/', $file)) { $content = $this->filesystem->get($file); } }); return $content; }