class Frontend implements ExtenderInterface
Methods
<p>Add a route to the frontend.</p>
<p>Register a new title driver to change the title of frontend documents.</p>
Details
at
line 43
__construct(string $frontend)
at
line 89
Frontend
route(string $path, string $name, callable|string|null $content = null)
<p>Add a route to the frontend.</p>
at
line 103
Frontend
removeRoute(string $name)
<p>Remove a route from the frontend.</p>
<p>This is necessary before overriding a route.</p>
at
line 123
Frontend
content(callable|string|null $callback)
<p>Modify the content of the frontend.</p>
at
line 156
Frontend
preloads(callable|array $preloads)
<p>Adds multiple asset preloads.</p>
<p>The parameter should be an array of preload arrays, or a callable that returns this.</p> <p>A preload array must contain keys that pertain to the <code><link rel="preload"></code> tag.</p> <p>For example, the following will add preload tags for a script and font file:</p> <pre><code>$frontend->preloads([ [ 'href' => '/assets/my-script.js', 'as' => 'script', ], [ 'href' => '/assets/fonts/my-font.woff2', 'as' => 'font', 'type' => 'font/woff2', 'crossorigin' => '' ] ]);</code></pre>