FluidTYPO3\Flux\Utility\PathUtility::translatePath PHP Method

translatePath() public static method

Translates an array of paths or single path into absolute paths/path
public static translatePath ( mixed $path ) : mixed
$path mixed
return mixed
    public static function translatePath($path)
    {
        if (is_array($path) == FALSE) {
            $path = 0 === strpos($path, '/') ? $path : GeneralUtility::getFileAbsFileName($path);
            if (is_dir($path) && substr($path, -1) !== '/') {
                $path = $path . '/';
            }
            $path = GeneralUtility::fixWindowsFilePath($path);
        } else {
            foreach ($path as $key => $subPath) {
                if (TRUE === in_array($key, self::$knownPathNames)) {
                    $path[$key] = self::translatePath($subPath);
                }
            }
        }
        return $path;
    }

Usage Example

 /**
  * @param array $row
  * @return array
  */
 public function getTemplatePaths(array $row)
 {
     $extensionName = $this->getExtensionKey($row);
     $paths = $this->configurationService->getContentConfiguration($extensionName);
     if (TRUE === is_array($paths) && FALSE === empty($paths)) {
         $paths = PathUtility::translatePath($paths);
         return $paths;
     }
     return parent::getTemplatePaths($row);
 }
All Usage Examples Of FluidTYPO3\Flux\Utility\PathUtility::translatePath
PathUtility