Form

public struct Form: Html

A wrapper for the HTML ‘form’ element.

  • Available posting methods

    See more

    Declaration

    Swift

    public enum Method: String
  • The HTML string generated for the content of this element.

    Declaration

    Swift

    public var html: String
  • Create a new ‘form’ element.

    Declaration

    Swift

    public init(_ klass: [String], _ id: String?, _ method: Method, _ action: String, _ content: [Html])

    Parameters

    klass

    The CSS class names that configure this element

    id

    (Optional) The CSS id name that configure this element

    method

    The method for posting the content input element status upon submit

    action

    The url to switch to upon submit

    content

    The content for this element

  • Create a new ‘form’ element.

    Declaration

    Swift

    public init(klass: [String] = [], method: Method, action: String, _ content: [Html])

    Parameters

    klass

    (Optional) The CSS class names that configure this element

    method

    The method for posting the content input element status upon submit

    action

    The url to switch to upon submit

    content

    The content for this element

  • Create a new ‘form’ element.

    Declaration

    Swift

    public init(klass: String, method: Method, action: String, _ content: [Html])

    Parameters

    klass

    The CSS class name that configures this element

    method

    The method for posting the content input element status upon submit

    action

    The url to switch to upon submit

    content

    The content for this element

  • Create a new ‘form’ element.

    Declaration

    Swift

    public init(klass: [String] = [], method: Method, action: String, _ content: Html...)

    Parameters

    klass

    (Optional) The CSS class names that configure this element

    method

    The method for posting the content input element status upon submit

    action

    The url to switch to upon submit

    content

    The content for this element

  • Create a new ‘form’ element.

    Declaration

    Swift

    public init(klass: String, method: Method, action: String, _ content: Html...)

    Parameters

    klass

    The CSS class name that configures this element

    method

    The method for posting the content input element status upon submit

    action

    The url to switch to upon submit

    content

    The content for this element

  • Create a new ‘form’ element.

    Declaration

    Swift

    public init(id: String, method: Method, action: String, _ content: [Html])

    Parameters

    id

    The CSS id name that configure this element

    method

    The method for posting the content input element status upon submit

    action

    The url to switch to upon submit

    content

    The content for this element

  • Create a new ‘form’ element.

    Declaration

    Swift

    public init(id: String, method: Method, action: String, _ content: Html...)

    Parameters

    id

    The CSS id name that configure this element

    method

    The method for posting the content input element status upon submit

    action

    The url to switch to upon submit

    content

    The content for this element

  • Appends the given content to the already present content (i.e. after)

    Declaration

    Swift

    public mutating func append(_ content: Html)

    Parameters

    content

    The content to be added