module CamlTemplate:A template processor.sig..end
Copyright © 2003, 2004, 2005 Benjamin Geer. Please see the file COPYING for licence information.
The latest version of this software can be found at
http://saucecode.org/camltemplate.
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 -> unitCamlTemplate.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 -> stringval dump : template -> stringexception 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 may be useful for dealing with
form input fields that can have multiple values.