module CamlTemplate: sig end
To use templates, first write template source code (see the manual
for instructions). Then create a template cache using the
CamlTemplate.Cache
module, and call
CamlTemplate.Cache.get_template
to create a
CamlTemplate.template
from your template source code.
To marge a template with data, put the data in a
CamlTemplate.Model.thash
. Then call CamlTemplate.merge
.
module Model: sig end
type
template
val merge : tmpl:template ->
model:Model.thash -> buf:Buffer.t -> unit
CamlTemplate.Model.thash
with
the template, and returns the resulting text in the buffer
provided.Template_error
if an error occurs in the
template.val get_name : template -> string
val dump : template -> string
exception Syntax_error of string
exception Template_error of string
module Cache: sig end
val add_web_functions : Model.thash -> unit
urlEncode
URL-encodes a string.escHtml
Escapes special characters in text to be included in an HTML document.escHtmlAttr
Escapes special characters in text to be included in an HTML attribute.escHtmlTextarea
Escapes special characters in text to be included in an HTML textarea
.asList
Converts any value to a list, if it isn't already a list. If the argument is
a list, returns the argument. If the argument is null, returns an empty list. Otherwise,
returns a single-element list containing the argument. This is useful for dealing with
form input fields that can have multiple values.