DocumentationController
extends Controller
in package
Resource Controller for the Documentation views.
Tags
Table of Contents
- realtimeAsset() : string
- Return a media file for the realtime viewer.
- show() : View
- Display the specified resource.
- handle404() : string
- Check if the specified slug exists as a page.
Methods
realtimeAsset()
Return a media file for the realtime viewer.
public
realtimeAsset(string $file) : string
Parameters
- $file : string
-
filename relative to the source media path
Tags
Return values
string —of the file contents
show()
Display the specified resource.
public
show(string $slug[, bool $realtime = false ]) : View
Parameters
- $slug : string
-
of the Markdown page to show
- $realtime : bool = false
-
is it a realtime request for on-the-fly generation?
Tags
Return values
View —handle404()
Check if the specified slug exists as a page.
private
handle404(string $slug) : string
If page is not found, we swap the slug out for a 404. This way the user's url is preserved, and we don't redirect to a 404 page which can be jarring for the user.
Parameters
- $slug : string
-
to validate
Return values
string —$slug the same slug if it exists, else 404