UIWebPage

open class UIWebPage

Represents a web page and contains all the HTML elements.

  • The head in a web page.

    Declaration

    Swift

    public var head: UIElement
  • The header of the page.

    Declaration

    Swift

    public var header: UIElement
  • The section between the header and the footer of the page.

    Declaration

    Swift

    public var section: UIElement
  • The footer of the page.

    Declaration

    Swift

    public var footer: UIElement
  • Creates a web page with a head, header, section and footer.

    Declaration

    Swift

    public init()

    Return Value

    A UIWebPage with all the neccasary elements.

  • Creates an instance of UIWebPage with the basic required elements.

    Declaration

    Swift

    convenience public init(title: String)

    Parameters

    title

    The title of the page.

  • For custom configuration of the web page before it is rendered. Over-ride this method to do anything before page rendering.

    Declaration

    Swift

    open func configure()
  • Renders the current page to a View with bytes that can be returned from a droplet route.

    Throws

    Any errors that get thrown when creating the view.

    Declaration

    Swift

    public func render()throws -> View

    Return Value

    A view that contains the pages HTML in bytes.

  • Adds dependancies that will be loaded into the webpage.

    Declaration

    Swift

    public func `import`(_ dependency: Dependency)

    Parameters

    dependancy

    The dependancy that will added to the webpage.

  • Handles auto rendering for routes.

    Throws

    Any errors generated from creating the view.

    Declaration

    Swift

    public func makeResponse() throws -> Response

    Return Value

    A response containing the view from rendering.