viewClassFormat
enum viewClassFormat =
q{
final class view_%s : View
{
import std.array : replace, split, array, join, split;
import std.algorithm : map, filter, countUntil, count, canFind, startsWith, endsWith, splitter;
import std..string : strip, stripLeft, stripRight, indexOf, lastIndexOf, isNumeric, format;
import std.datetime : Date, DateTime, SysTime, Clock, Month, DayOfWeek;
import std.conv : to;
import diamond.http;
import diamond.errors.exceptions;
import diamond.controllers;
import diamond.markdown;
import diamond.core.meta;
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)
{
import std.file : write;
write("ERRORS.txt", e.toString);
throw new ViewException(super.name, e);
}
catch (Throwable t)
{
import std.file : write;
write("ERRORS.txt", t.toString);
throw new ViewError(super.name, t);
}
}
}
};
The format for view classes when using web-servers.