Will make $pathname look for a source file relative to root_path.
+
+
+ false
+
Will make $pathname look for a source file relative to the root of the whole filesystem.
+
+
+
+
+
Return value
+
+
+
string
+
Returns a minified version of the included source file as a string. If a file can not be found at $pathname, an empty string is returned.
+
+
+
+
Examples
+
+
+
Importing a code snippet into a page
+
In this example we will be including a PHP file that contains reusable code (a banner) from /snippets/banner.php into a Vegvisir page /public/index.php.
+
+
+ = VV::include("elements/HTMLCodeDemoElement?id=docs/v3.1.3/PHP/VV/include/example_import") ?>
+
+
\ No newline at end of file
diff --git a/public/docs/v3.1.3/PHP/VV/init.php b/public/docs/v3.1.3/PHP/VV/init.php
new file mode 100644
index 0000000..1fa5d8e
--- /dev/null
+++ b/public/docs/v3.1.3/PHP/VV/init.php
@@ -0,0 +1,36 @@
+= VV::include("snippets/docs/v3.1.3/shell") ?>
+
+ = VV::include("snippets/docs/version-select"); ?>
+
+
VV::init()
+
Initialize the Vegvisir front-end.
+
Place this as close to the bottom of your body tag in your shell_page as possible.
Returns a script tag with the compiled and minified JavaScript required to run the Vegvisir front-end.
+
+
+
+
Examples
+
+
+
Initializing a Vegvisir website
+
In this example we will initialize a single-page website with the two required files to run a bare-bones Vegvisir website: /public/index.php and /public/shell.php.
+
+
+ = VV::include("elements/HTMLCodeDemoElement?id=docs/v3.1.3/PHP/VV/init/example_init") ?>
+
+
\ No newline at end of file
diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/JS/abort/description/syntax.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/JS/abort/description/syntax.js.php
new file mode 100644
index 0000000..1908234
--- /dev/null
+++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/JS/abort/description/syntax.js.php
@@ -0,0 +1 @@
+
newNavigation().abort->AbortController
\ No newline at end of file
diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/JS/abort/example_abort/example.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/JS/abort/example_abort/example.js.php
new file mode 100644
index 0000000..efed215
--- /dev/null
+++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/JS/abort/example_abort/example.js.php
@@ -0,0 +1 @@
+
constnav=newvegvisir.Navigation("some/page");
// Abort initialized navigation
nav.abort.abort();
// Navigate to URL if not aborted
if (!nav.abort.aborted) {
nav.navigate();
}
\ No newline at end of file
diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/description/syntax.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/description/syntax.php.php
new file mode 100644
index 0000000..cd4bb9b
--- /dev/null
+++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/description/syntax.php.php
@@ -0,0 +1 @@
+
<?php
VV::include(
string$pathname,
bool$relative = true
): string
\ No newline at end of file
diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/banner.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/banner.php.php
new file mode 100644
index 0000000..c66c006
--- /dev/null
+++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/banner.php.php
@@ -0,0 +1 @@
+
<sectionclass="banner">
<h1>This snippet can be imported into any page with VV::include()</h1>
<p>We can also use native PHP templating to perform SSR.</p>
<p>Did we get a foo? <?=array_key_exists("foo", $_GET) ? "yes we did" : "no we didn't"?>.</p>
</section>
\ No newline at end of file
diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/compiled.html.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/compiled.html.php
new file mode 100644
index 0000000..5faf7a0
--- /dev/null
+++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/compiled.html.php
@@ -0,0 +1 @@
+
<main>
<sectionclass="banner">
<h1>This snippet can be imported into any page with VV::include()</h1>
<p>We can also use native PHP templating to perform SSR.</p>
<p>Did we get a foo? yes we did.</p>
</section>
<section>
<h1>Hey psst!</h1>
<p>You can pass search parameters to included pages and they will be accessible in their own scope under the $_GET superglobal</p>
</section>
</main>
\ No newline at end of file
diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/index.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/index.php.php
new file mode 100644
index 0000000..dfd9fa4
--- /dev/null
+++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/index.php.php
@@ -0,0 +1 @@
+
<main>
<?=VV::include("snippets/banner?foo=bar") ?>
<section>
<h1>Hey psst!</h1>
<p>You can pass search parameters to included pages and they will be accessible in their own scope under the $_GET superglobal</p>
</section>
</main>
\ No newline at end of file
diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/description/syntax.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/description/syntax.php.php
new file mode 100644
index 0000000..9f78810
--- /dev/null
+++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/description/syntax.php.php
@@ -0,0 +1 @@
+
<?php
VV::init(): string
\ No newline at end of file
diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/compiled.html.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/compiled.html.php
new file mode 100644
index 0000000..26113a5
--- /dev/null
+++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/compiled.html.php
@@ -0,0 +1 @@
+
<p>This index.php file present at the root of the "/public" directory will be loaded as this website's main landing page.</p>
</section>
</vv-shell>
<script>...</script>
</body>
</html>
\ No newline at end of file
diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/index.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/index.php.php
new file mode 100644
index 0000000..f99e45d
--- /dev/null
+++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/index.php.php
@@ -0,0 +1 @@
+
<section>
<h1>Hey!</h1>
<p>This index.php file present at the root of the "/public" directory will be loaded as this website's main landing page.</p>
</section>
\ No newline at end of file
diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/shell.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/shell.php.php
new file mode 100644
index 0000000..369b3eb
--- /dev/null
+++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/shell.php.php
@@ -0,0 +1 @@
+
<?php// The landingpage "/public/index.php" will be loaded INTO this vv-shell element ?>
<vv-shell></vv-shell>
<?=VV::init() ?>
</body>
</html>
\ No newline at end of file
diff --git a/snippets/docs/v3.1.3/aside.php b/snippets/docs/v3.1.3/aside.php
index eb1596c..2cbf6b1 100644
--- a/snippets/docs/v3.1.3/aside.php
+++ b/snippets/docs/v3.1.3/aside.php
@@ -38,10 +38,6 @@