I’m using Symfony 5.3.9 and try to load a file into a Service-controller.
I use the assets-component with emptyVersionStrategy.
my filesystem:
/assets/vorlagen/XXX.html
My Service-Controller-Code:
$package = new PathPackage('/assets/vorlagen', new EmptyVersionStrategy());
$template = $package->getUrl($anzeige->getTemplate()->getDatei());
$handle = file_get_contents($template);
The error-Message:
Warning: file_get_contents(/assets/vorlagen/XXX.html): failed to open stream: No such file or directory
When I simply return $anzeige->getTemplate()->getDatei() the name of the file is correct
and