Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Canvas Technology platform provides a mechanism to render templates (CTTPL files) using the Template Manager's API. The Template Manager is responsible for creating, loading, and processing all the template files.

The Template Manager's createTemplate method (API) enables you to render any template on to an object. TheĀ createTemplate API takes the following parameters:

ParameterData TypeMandatory or OptionalDescription
TemplateUrlsStringMandatoryThis parameter denotes the template URLs or the file names, which can be a string or an array of URLs.
tmplParamsStringOptionalThis optional parameter denotes the template parameters, which can be an array of values to be passed to the place holders of the templates. An empty object can also be passed as the parameter.
basePathStringOptionalThis optional parameter denotes the template URLs. An empty object can be passed as the parameter.

The createTemplate API returns the new instance of the Template Manager class.

Sample usage of the createTemplate API for application layout is as follows:

var tmpLayer = canvas.templateManager.createTemplate('al-app-footer.cttpl',AppFooter,canvas.util.getFWTemplatePath());
/* Here, 
*  'al-app-footer.cttpl' is the template file.
*  'AppFooter' is the template parameter. 
*  'canvas.util.getFWTemplatePath' is the function that fetches the template path.
*/



  • No labels