ComponentPro UltimateTemplateEngine

Loading template from file

Language Filter: AllSend comments on this topic to ComponentPro

This topic demonstrates how to load a template from a file.

To load a template from a string you should use LoadFromFile method of the TemplateEngine class, as shown in the following example: 

{%bool flag = true/}
{%if flag == true%}

Generated by $name$


Flag is set to False


The output will be:

Generated by UltimateTemplateEngine

using System;
using ComponentPro;


TemplateEngine dt = new TemplateEngine();
string output = dt.Run();