hb.web.web

Implements a declarative framework for building web interfaces.

This module contains the sister funtionality to the hb.web.rest module. While the REST interface generator is meant for stateless machine-to-machine communication, this module aims at implementing user facing web services. Apart from that, both systems use the same declarative approach.

See registerWebInterface for an overview of how the system works.

Public Imports

hb.web.common
public import hb.web.common;
Undocumented in source.
hb.web.i18n
public import hb.web.i18n;
Undocumented in source.
hb.web.validation
public import hb.web.validation;
Undocumented in source.

Members

Classes

WebInterfaceSettings
class WebInterfaceSettings

Encapsulates settings used to customize the generated web interface.

Functions

header
void header(string name, string value)

sets a response header

nestedNameStyle
NestedNameStyleAttribute nestedNameStyle(NestedNameStyle style)

Determines how nested D fields/array entries are mapped to form field names.

redirect
void redirect(string url)

Redirects to the given URL.

registerWebInterface
URLRouter registerWebInterface(URLRouter router, C instance, WebInterfaceSettings settings)

Registers a HTTP/web interface based on a class instance.

terminateSession
void terminateSession()

Terminates the currently active session (if any).

trWeb
string trWeb(string text, string context)
string trWeb(string text, string plural_text, int count, string context)

Translates text based on the language of the current web request.

Imports

PrivateAccessProxy (from vibe.internal.meta.funcattr)
public import vibe.internal.meta.funcattr : PrivateAccessProxy, before, after;
Undocumented in source.
after (from vibe.internal.meta.funcattr)
public import vibe.internal.meta.funcattr : PrivateAccessProxy, before, after;
Undocumented in source.
before (from vibe.internal.meta.funcattr)
public import vibe.internal.meta.funcattr : PrivateAccessProxy, before, after;
Undocumented in source.

Properties

errorDisplay
errorDisplay [@property getter]

Attribute to customize how errors/exceptions are displayed.

noRoute
NoRouteAttribute noRoute [@property getter]

Methods marked with this attribute will not be treated as web endpoints.

status
void status [@property getter]

sets the response status code

Structs

SessionVar
struct SessionVar(T, string name)

Maps a web interface member variable to a session field.

Templates

render
template render(string diet_file, ALIASES...)

Renders a Diet template file to the current HTTP response.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.

Authors

Sönke Ludwig