$baseTemplate : string
The View class provides the functionality of dynamically creating web pages. Essentially the eventual response to the client.
See the docs at discophp.com/docs/View
json(null|mixed $data = null, integer $code = 200) : void
Specify that the output of this view should be JSON. If `$data` is provided the response will be sent immeditatly and the application will exit.
The response to JSON encode and return to the client. If
The HTTP response code to be returned to the client.
schema(string|array $keyOrData, mixed|null $value = null)
Set information to be used in schema.org json-ld data that will be set in the header of the view.
Either a key to set in the schema, or an array to merge with the current schema.
A value to set in the schema or null if
appendLastMod(string $path, string $var = 'c') : string
Append the last modified time to a resource path in a GET variable (default is `c`). This can be useful if your caching assets via `.htaccess` rules and you dont want to have to rename them manually after every change.
The path to the resource as used in the front end.
The GET variable name to store the last modified time in.
The path with the last modified time appended.
serve(integer $code = 200, boolean|string|\Closure $action = false) : void
Serve a specified http response code page by either executing a template or the passed \Closure $fun function, or loading the \Closure function from the file $this->errorDir . $code.php and executing it or by a default message set by the function.
The http repsonse code sent to the client from the server.
A template or closure to execute when $code != 200.
When print page is called if there is schema information to add to the head of the page this will add it inside a script tag with the type set to `application/ld+json`. This will also check and see if the key `@context` has been set, if not it will be set to `http://schema.org`.