public function getFilePath(IFile $file, string $format, array $formatterConfig = []): ?string
    {
        $alias = $this->getAliasConfig($file->getModelAlias());
        $formatter = $this->buildFormatter($file, $format, $formatterConfig);
        $targetPath = $alias->getAssetPath($file, $format);

        if (!$this->cacheFile($file, $formatter, $targetPath)) {
            return null;
        }

        return $targetPath;
    }
public function getFilePath(IFile $file, string $format, array $formatterConfig = []): ?string
    {
        $alias = $this->getAliasConfig($file->getModelAlias());
        $formatter = $this->buildFormatter($file, $format, $formatterConfig);
        $targetPath = $alias->getAssetPath($file, $format);

        if (!$this->cacheFile($file, $formatter, $targetPath)) {
            return null;
        }

        return $targetPath;
    }
public function getFilePath ( IFile $ file , string $ format , array $ formatterConfig = [ ] ) : ? string { $ alias = $ this -> getAliasConfig ( $ file -> getModelAlias ( ) ) ; $ formatter = $ this -> buildFormatter ( $ file , $ format , $ formatterConfig ) ; $ targetPath = $ alias -> getAssetPath ( $ file , $ format ) ; if ( ! $ this -> cacheFile ( $ file , $ formatter , $ targetPath ) ) { return null ; } return $ targetPath ; }
Caches file and returns url to it.
@param IFile $file
@param string $format
@param array $formatterConfig
@return string|null path to image in cacheFS or null if fails
@throws \InvalidArgumentException
@throws \RuntimeException
@throws \League\Flysystem\FileNotFoundException
@throws InvalidConfigException
Caches file and returns url to it .