public function formatLayoutFile(Presenter $presenter)
 {
     $layoutFiles = [];
     $layout = $presenter->getLayout() ? $presenter->getLayout() : 'layout';
     foreach ([$this->getThemeManager()->getCurrentTheme(), $this->getThemeManager()->getFallbackTheme()] as $theme) {
         $name = $presenter->getName();
         $presenterName = substr($name, strrpos(':' . $name, ':'));
         $dir = $this->unifyDirectorySeparators($this->getThemeManager()->getThemesDir() . DIRECTORY_SEPARATOR . $theme . DIRECTORY_SEPARATOR . $presenter->getReflection()->getNamespaceName());
         $dir = is_dir("{$dir}/templates") ? $dir : dirname($dir);
         $layoutFiles[] = $this->unifyDirectorySeparators("{$dir}/templates/{$presenterName}/@{$layout}.latte");
         $layoutFiles[] = $this->unifyDirectorySeparators("{$dir}/templates/{$presenterName}.@{$layout}.latte");
         do {
             $layoutFiles[] = $this->unifyDirectorySeparators("{$dir}/templates/@{$layout}.latte");
             $dir = dirname($dir);
         } while ($dir && ($name = substr($name, 0, strrpos($name, ':'))));
     }
     return $layoutFiles;
 }