I’ve got an SVG in my assets folder. I would like to be able to echo the actual markup that is in that file as opposed to just throwing the SVG into an <img />
. I would like to do this so that I can manipulate the SVG with CSS.
I can put the SVG in a snippet called “logo.php” and load it in like this: <?php snippet("logo"); ?>
but I prefer to have my images in the actual assets folder. Is there any way I can read the contents of an asset?
I was hoping I could use something like:
<?php url('assets/images/move-this-logo.svg')->read(); ?>
But of course this doesn’t work because read()
doesn’t know what to do with a string. Any help would be greatly appreciated!