Package io.ktor.server.html

Types

Link copied to clipboard
class HtmlContent(status: <ERROR CLASS>?, builder: <ERROR CLASS>.() -> Unit)

Represents an OutgoingContent build using kotlinx.html.

Link copied to clipboard
open class Placeholder<TOuter>

A placeholder that is inserted inside TOuter.

Link copied to clipboard
class PlaceholderItem<TOuter>(index: Int, collection: List<PlaceholderItem<TOuter>>) : Placeholder<TOuter>

An item of a PlaceholderList when it is expanded.

Link copied to clipboard
open class PlaceholderList<TOuter, TInner>

A placeholder that can be used to insert the content that appears multiple times (for example, list items).

Link copied to clipboard
interface Template<in TOuter>

A template that expands inside TOuter.

Link copied to clipboard
open class TemplatePlaceholder<TTemplate>

A placeholder that is also a Template. It can be used to insert child templates and create nested layouts.

Functions

Link copied to clipboard
fun <TOuter, TInner> TOuter.each(items: PlaceholderList<TOuter, TInner>, itemTemplate: TOuter.(PlaceholderItem<TInner>) -> Unit)

Inserts every element of PlaceholderList.

Link copied to clipboard
fun <TOuter> TOuter.insert(placeholder: Placeholder<TOuter>)

Inserts Placeholder.

fun <TTemplate : Template<TOuter>, TOuter> TOuter.insert(template: TTemplate, placeholder: TemplatePlaceholder<TTemplate>)
fun <TOuter, TTemplate : Template<TOuter>> TOuter.insert(template: TTemplate, build: TTemplate.() -> Unit)
Link copied to clipboard
suspend fun <ERROR CLASS>.respondHtml(status: <ERROR CLASS> = HttpStatusCode.OK, block: <ERROR CLASS>.() -> Unit)

Responds to a client with an HTML response using the specified block to build an HTML page. You can learn more from HTML DSL.

Link copied to clipboard
suspend fun <TTemplate : Template<<ERROR CLASS>>> <ERROR CLASS>.respondHtmlTemplate(template: TTemplate, status: <ERROR CLASS> = HttpStatusCode.OK, body: TTemplate.() -> Unit)

Responds to a client with an HTML response built based on a specified template. You can learn more from HTML DSL.