Nxs smarty - xkp/Doc GitHub Wiki

##Overview

While we endorse AutoTemplates as the correct way to develop web sites; we acknowledge we must provide a solution developers are comfortable with and one that will solve specific problems where AutoTemplates might not be sufficient. Our solution was to include the smarty template engine into node.xs

Smarty is an industry standard and is familiar to most developers, you can find documentation here and see here the implementation we used.

##Usage

We offer two different ways of using smarty in node.xs:

####Smarty with AutoTemplates

You can use the smarty syntax together with AutoTemplates by means of a dsl construct. The user must specify the html id of the element which will hold the generated tags along with the parameters to be used:

on <page>.render()
{
    smarty(html_id="<html element id>", <smarty text parameters>)
    {
       //smarty text here
    }  
}

####Standalone Smarty

You can also render the whole page using Smarty by redirecting to a tpl file:

on <page>.render()
{
    return redirect(tpl = <smarty file>, <smarty arguments>);
}
⚠️ **GitHub.com Fallback** ⚠️