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