protected getLocalizedTemplate ( $filename ) : string | null | ||
return | string | null | a localized template file if found, null otherwise. |
protected function getLocalizedTemplate($filename)
{
if (($app = $this->getApplication()->getGlobalization(false)) === null) {
return is_file($filename) ? $filename : null;
}
foreach ($app->getLocalizedResource($filename) as $file) {
if (($file = realpath($file)) !== false && is_file($file)) {
return $file;
}
}
return null;
}