The OpenD Programming Language

dispatchTo

Dispatches the URL (and anything under it) to another dispatcher function. The function should look something like this:

bool other(DD)(DD dd) {
	return dd.dispatcher!(
		"/whatever".serveRedirect("/success"),
		"/api/".serveApi!MyClass
	);
}

The DD in there will be an instance of DispatcherData which you can inspect, or forward to another dispatcher here. It is a template to account for any Presenter type, so you can do compile-time analysis in your presenters. Or, of course, you could just use the exact type in your own code.

You return true if you handle the given url, or false if not. Just returning the result of dispatcher will do a good job.

version(with_breaking_cgi_features)
dispatchTo
(
alias handler
)
(
string urlPrefix
)

Meta