(Vegvisir 2, Vegvisir 3)
VV::embed()Import and inline the contents of any file without executing code.
VV::embed() returns the contents of any file as a string.
pathnamePath to a file to embed relative from project root.
relativePath provided to pathname will be a relative when this parameter is true (default). Set to false to make path absolute.
stringA string containing the raw contents of the file. File encoding is preserved.
Will return an empty string if the path provided to pathname is not a valid file, or if it failed to import.
Here is an example the embeds an SVG file directly on a page.
This can come in handy for small icons stored in a separate directory as an example.
= Snippet::put("docs/API/PHP/VV/css/example-1-0", Snippet::CSS) ?> = Snippet::put("docs/API/PHP/VV/css/example-1-1", Snippet::PHP) ?>By using VV::css() inside a style, we've enabled this stylesheet for that specific page.