viewClassFormat
- enum viewClassFormat;
static if(!isWebApi)
static if(isWebServer)
enum viewClassFormat =
q{
final class view_%s : View
{
import std.array : replace, split, array;
import std.algorithm : map, filter, countUntil, count, canFind;
import std..string : strip, indexOf, lastIndexOf, isNumeric;
import std.datetime : Date, DateTime, SysTime, Clock, Month, DayOfWeek;
import std.conv : to;
import vibe.d : HTTPServerRequest, HTTPServerResponse, HTTPMethod;
import diamond.http;
import diamond.errors.exceptions;
import diamond.controllers;
import i18n = diamond.data.i18n;
import controllers;
import models;
public:
final:
// viewClassMembers
%s
this(HttpClient client, string name)
{
super(client, name);
// viewConstructor
%s
}
// modelGenerate
%s
override string generate(string sectionName = "")
{
try
{
// controller
%s
// placeHolders
%s
switch (sectionName)
{
// view code
%s
}
// end
%s
}
catch (Exception e)
{
throw new ViewException(super.name, e);
}
catch (Throwable t)
{
throw new ViewError(super.name, t);
}
}
}
};
- enum viewClassFormat;
The format for view classes when using web-servers.