If you are in an extension class, or some other place that doesn't have a direct way to inject a MediaFileManager instance, you'll have to pass it in as a method argument. Then the caller, be it a view or controller, can inject in the MediaFileManager instance and pass it to your method.
Yeah, am trying to use it in a Method from a Service since it's a handy thing just all over the site not in any one particular view. I had been experimenting with the mediaFileManager but it always came out null. I thought passing a service into a service was a silly way to go about it but I suppose I was wrong xD Not well versed outside of HTML/CSS land.
Replacing 'Current' for File Service (Rendering SVG Inline)
Afternoon all ^^ How does one get an SVG to render inline without 'Current' in v9?
What worked for v8 (as helped here):
What do you replace the old Composing.Current with when using this in a Service since v9 did away with it?
If you are in a view, you can use view injection to get the IMediaFileManager reference, then use that to get to the file, as is shown below.
If you are in an extension class, or some other place that doesn't have a direct way to inject a MediaFileManager instance, you'll have to pass it in as a method argument. Then the caller, be it a view or controller, can inject in the MediaFileManager instance and pass it to your method.
Yeah, am trying to use it in a Method from a Service since it's a handy thing just all over the site not in any one particular view. I had been experimenting with the mediaFileManager but it always came out null. I thought passing a service into a service was a silly way to go about it but I suppose I was wrong xD Not well versed outside of HTML/CSS land.
Thanks so much Benjamin!
<3
is working on a reply...