NSmarty is a ported PHP Smarty template engine. NSmarty suport all well known: variable output, variable modifiers, block, assign, include, loop through arrays and more.
Also, NSmarty have a strong caching feature which make your application very faster.
Using client side templates lets you avoid hassle of tedious and error-prone manual manipulations with strings and DHTML objects, and helps you create Model-View-Controller JavaScript application where the presentation and the logic are clearly separated.
Although there are a lot of browser-side Javascript template engines available, NSmarty has some unique features that sets this project apart from the rest.
jSmart implements rich and well established syntax of the popular PHP template engine Smarty familiar to many developers around the world. Together with limitied build-in support for PHP language constructs and libraries like php.js it creates possibility to use the same set of templates both on the server and the client side.
NSmarty documentation is still incomplete, but you can use Smarty documentation on www.smarty.net/docs/en/. Almost all of Smarty 3 (and Smarty 2) syntax is supported.
// Authors: Dorin Grigoras , Max Miroshnikov.
// http://www.gnu.org/licenses/lgpl.html
@authors: Dorin Grigoras , Max Miroshnikov.
@license: www.gnu.org/licenses/lgpl.html
@website: nsmarty.stepofweb.com/
@install: npm install nsmarty
NSmarty is a port of the Smarty Template Engine to Javascript, a JavaScript template library that supports the template syntax and all the features (functions, variable modifiers, etc.) of the well-known PHP template engine Smarty.
NSmarty is written entirely in JavaScript, does not have any DOM/DHTML/browser or third-party JavaScript library dependencies.
NSmarty supports plugin architecture, you can extend it with custom plugins: functions, blocks and variable modifiers, templates inclusion, templates inheritance and overriding, caching, escape HTML.
NSmarty allows you to use the same Smarty templates on both server and client side, for both PHP and Node.js.