facet classafPillow::Page

sys::Obj
  afPillow::Page : sys::Facet

@FacetMeta { inherited=true }
@Serializable

Place on a EfanComponent to define a Pillow web page.

contentType

Source

const MimeType? contentType

Use to set an explicit Content-Type the page should be served with. The Content-Type is set in the HTTP response header.

using afPillow
using afEfanXtra

@Page { contentType=MimeType("text/plain") }
const mixin Matrix : EfanComponent { ... }
disableRouting

Source

const Bool disableRouting := false

If true then Page Routes, including events and welcome page redirects, are not added to BedSheet.

Defaults to false

httpMethod

Source

const Str httpMethod := "GET HEAD"

The HTTP method the Page should respond to.

Defaults to GET HEAD

template

Source

const Uri? template

By default, pillow looks for a template with the same name as the page class.

Use this to explicitly set the location of efan template. The URI may take several forms:

  • if fully qualified, the template is resolved, e.g. fan://acmePod/templates/Notice.efan
  • if relative, the template is assumed to be on the file system, e.g. etc/templates/Notice.efan
  • if absolute, the template is assumed to be a pod resource, e.g. /templates/Notice.efan
url

Source

const Uri? url

Use to map the page to a specific URL. Page URLs should start with a leading /slash/. Example:

using afEfanXtra
using afPillow

@Page { url=`/matrix_explained.html` }
const mixin Matrix : EfanComponent { ... }

The URL is a standard route glob and should contain an asterisk for every page context required. e.g. /user/*