diamond ~master (2020-03-31T19:16:28Z)
Home
Dub
Repo
viewClassFormat
diamond
views
viewformats
The format for view classes when using stand-alone.
static if
(!(
isWebServer
))
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.errors.exceptions
;
import
diamond.core.meta
;
import
models
;
public
:
final
:
// viewClassMembers
%
s
this
(
string
name
) {
super
(
name
);
// viewConstructor
%
s
}
// modelGenerate
%
s
override
string
generate
(
string
sectionName
=
""
) {
try
{
// 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
); } } }
}
;
Meta
Source
See Source File
diamond
views
viewformats
manifest constants
appendFormat
controllerConstructorFormat
controllerHandleFormat
controllerMemberFormat
endFormat
escapedFormat
layoutConstructorFormat
modelGenerateFormat
modelMemberFormat
placeholderFormat
updateModelFromRenderViewFormat
viewClassFormat
The format for view classes when using stand-alone.