website/public/docs/v3.1.3/API/PHP/VV/include.php

77 lines
No EOL
2.3 KiB
PHP

<?= VV::include("modules/snippet/Snippet.php") ?>
<?php // General information ?>
<section class="md">
<container>
<p>(Vegvisir 2, Vegvisir 3)</p>
<h1><code>VV::include()</code></h1>
<p>Inline contents of one page inside another page.</p>
<p>The syntax and functionality is similar to <a href=""><code>VV::embed()</code></a>, except it executes included code.</p>
</container>
</section>
<section class="md">
<container>
<h1>Description</h1>
<?= Snippet::put("docs/API/PHP/VV/include/description", Snippet::PHP) ?>
<p><code>VV::include()</code> lets you put the contents of one page into another page.</p>
</container>
</section>
<?php // Method parameters ?>
<section class="md">
<container>
<h2>Parameters</h2>
</container>
</section>
<section class="md inset">
<container>
<h3><code>pathname</code></h3>
<p>Path to a PHP file to import and evaluate relative from <a href="">project root</a>.</p>
<details>
<summary>Example</summary>
<?= Snippet::put("docs/API/PHP/VV/include/0", Snippet::PHP) ?>
</details>
</container>
</section>
<section class="md inset">
<container>
<h3><code>relative</code></h3>
<p>Path provided to <a href=""><code>pathname</code></a> will be a relative when this parameter is <code>true</code> (default). Set to <code>false</code> to make path absolute.</p>
<details>
<summary>Example</summary>
<?= Snippet::put("docs/API/PHP/VV/include/1", Snippet::PHP) ?>
</details>
</container>
</section>
<?php // Method return values ?>
<section class="md">
<container>
<h2>Return values</h2>
</container>
</section>
<section class="md inset">
<container>
<p>This method will return whatever the compiled output of the included PHP file will be.</p>
</container>
</section>
<?php // Examples ?>
<section class="md">
<container>
<h1>Examples</h1>
</container>
</section>
<section class="md inset">
<container>
<h2>Basic usage</h2>
<p>Consider the following page snippet</p>
<?= Snippet::put("docs/API/PHP/VV/include/example-1-0", Snippet::PHP) ?>
<p>Let's put this snippet into another page</p>
<?= Snippet::put("docs/API/PHP/VV/include/example-1-1", Snippet::PHP) ?>
<p>By importing the snippet with <code>VV::include()</code> we have placed the <code class="tag">banner</code> tag and its contents into another page.</p>
</container>
</section>
<?php // Contribute ?>
<?= VV::shell("shells/docs") ?>