SVG v1.1.2 SVG.Server View Source
Cache for base64 encoded SVGs.
To use in templates:
<img src="<%=raw SVG.Server.get("logo") %>">
This will fetch “logo.svg” which is relative to the priv/static/images folder.
If that’s a bit too long to type, you can just alias it for use in view/templates:
alias SVG.Server, as: SVG
Link to this section Summary
Functions
Get SVG by file name
Initialises the process; reads all svgs in the priv/static/images
folder to build up the cache
Lists currently cached resources
Starts server
Link to this section Functions
Get SVG by file name.
If you need to fetch “icons/add.svg”, just call “icons/add” (no need for .svg).
Initialises the process; reads all svgs in the priv/static/images
folder to build up the cache.
Lists currently cached resources.
Starts server.