BaseController

Wrapper for a base controller.

Constructors

this
this()

Creates a new base controller.

Members

Aliases

ActionEntry
alias ActionEntry = Action[string]

Alias for the action entry.

MethodEntry
alias MethodEntry = ActionEntry[HttpMethod]

Alias for the method entry.

Functions

get
T get(string name, T defaultValue = T.init)

Gets a value from the passed data.

handle
Status handle()

Will handle the controller.

mapAction
void mapAction(HttpMethod method, string action, Action fun)

Maps an action to a http method by a name.

mapAction
void mapAction(HttpMethod method, string action, Status delegate() d)

Maps an action to a http method by a name.

mapAction
void mapAction(HttpMethod method, string action, Status function() f)

Maps an action to a http method by a name.

mapDefault
void mapDefault(Action fun)

Maps a default action for the controller.

mapDefault
void mapDefault(Status delegate() d)

Maps a default action for the controller.

mapDefault
void mapDefault(Status function() f)

Maps a default action for the controller.

mapMandatory
void mapMandatory(Action fun)

Maps a mandatory action for the controller.

mapMandatory
void mapMandatory(Status delegate() d)

Maps a mandatory action for the controller.

mapMandatory
void mapMandatory(Status function() f)

Maps a mandatory action for the controller.

mapValue
void mapValue(string data, string mapName = null)

Maps a value that was passed to the route in a RESTful manner.

validateRoute
void validateRoute(RoutePart[] routeData, string[] sourceData)

Valiates a route and the passed source data to it.

Properties

testing
bool testing [@property getter]

Gets a boolean determnining whether the request is a test or not.

Variables

_actions
MethodEntry _actions;

Collection of actions.

_data
Variant[string] _data;

Data passed by the request in a RESTful manner.

_defaultAction
Action _defaultAction;

The default action for the controller.

_mandatoryAction
Action _mandatoryAction;

The mandatory action for the controller.

Meta