class Frontend implements ExtenderInterface
Methods
<p>Add a route to the frontend.</p>
Details
at
line 42
__construct(string $frontend)
at
line 88
Frontend
route(string $path, string $name, callable|string|null $content = null)
<p>Add a route to the frontend.</p>
at
line 102
Frontend
removeRoute(string $name)
<p>Remove a route from the frontend.</p>
<p>This is necessary before overriding a route.</p>
at
line 155
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>