arsd.webtemplate

This provides a kind of web template support, built on top of arsd.dom and arsd.script, in support of arsd.cgi.

1 <main>
2 	<%=HTML some_var_with_html %>
3 	<%= some_var %>
4 
5 	<if-true cond="whatever">
6 		whatever == true
7 	</if-true>
8 	<or-else>
9 		whatever == false
10 	</or-else>
11 
12 	<for-each over="some_array" as="item">
13 		<%= item %>
14 	</for-each>
15 	<or-else>
16 		there were no items.
17 	</or-else>
18 
19 	<render-template file="partial.html" />
20 </main>

Functions available: encodeURIComponent, formatDate, dayOfWeek, formatTime

Public Imports

arsd.jsvar
public import arsd.jsvar : var;

Members

Classes

TemplateException
class TemplateException

Undocumented in source.

Functions

expandTemplate
void expandTemplate(Element root, var context)

Undocumented in source. Be warned that the author may not have intended to support it.

populateForm
void populateForm(Form form, var obj, string name)

Undocumented in source. Be warned that the author may not have intended to support it.

renderTemplate
Document renderTemplate(string templateName, var context, var skeletonContext)

Undocumented in source. Be warned that the author may not have intended to support it.

Structs

RenderTemplate
struct RenderTemplate

Can be used as a return value from one of your own methods when rendering websites with WebPresenterWithTemplateSupport.

Skeleton
struct Skeleton

UDA to put on a method when using WebPresenterWithTemplateSupport. Overrides the default template skeleton file name.

Template
struct Template

UDA to put on a method when using WebPresenterWithTemplateSupport. Overrides default generic element formatting and instead uses the specified template name to render the return value.

Templates

WebPresenterWithTemplateSupport
template WebPresenterWithTemplateSupport(CTRP)

Make a class that inherits from this with your further customizations, or minimally:

Variables

daysOfWeekFullNames
auto daysOfWeekFullNames;

Undocumented in source.

Meta