Valley Tpl

JavaScript Template Engine For ValleyJS
Alternatives To Valley Tpl
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Avalon5,74340184 years ago37February 07, 2018122otherJavaScript
an elegant efficient express mvvm framework
Valley Tpl21
4 years agoJavaScript
JavaScript Template Engine For ValleyJS
Askme18
6 months ago6mitKotlin
Social media app to ask and answer user questions and interact with users
Node Library6
3 years ago3CSS
全栈项目 使用nodejs作为后台 vue作为前台 使用axios进行交互 使用代理解决跨域问题(本项目已废弃,作者正在写新版本)
Simplemvvmtoolkit.samples.wpf4
4 years agomitC#
Windows Presentation Foundation Sample for Simple MVVM Toolkit Express
Meteor Chatroom4
7 years agoJavaScript
Mongodb3
5 years agoCSS
小米商城
Iappraise2
5 years agoagpl-3.0JavaScript
Anonymous appraise system
Youtubeplayer Kotlin2
5 years agoKotlin
simple mock Youtube-like player using MVVM-Architecture Components(Data-Binding, Room, ViewModel, LiveData), Dagger2, Retrofit and RxAndroid and Backend in NodeJS with mongodb
Alternatives To Valley Tpl
Select To Compare


Alternative Project Comparisons
Readme

ValleyTpl

1.1

ValleyTplJavascript StringBased Browser NodeJS

Express\Koa\koa2

MVVM DomBased MVVM StringBased

npm i
npm test

Run in Browser

valleytpl.jsvalleytpl.min.js

npm run build:web

ValleyTpl

<script src="dist/valleytpl.js"></script>
<script src="dist/valleytpl.min.js"></script>



vtpl.useCache = true; // truefalse



vtpl(tpl, data);

Run in NodeJS

NoedeJS > 8.0

vtpl-node.js

npm run build:node



const vtpl = require('./dist/index.js');



npm i valley-tpl
const vtpl = require('valley-tpl');



// run in async function
let tplContent = await vtpl.prepareTpl(tpl);
vtpl(tplContent, data);



vtpl.prepareTpl(tpl).then(tplContent => vtpl(tplContent, data));



vtp.setConfig({
  extension, // xtpl
  encoding, // utf-8
  useCache, // truecache
})

API

0.

{* ... *} // 
*** ... // 

1.

{{name}} // 
{{name|filter}} // 
{{name|filter:1,"a"}} // namefilter



vtpl.register('functionName', function)



vtpl.unregister('functionName')



* htmlspecialchars //  HTML 
* datestr // 

2.

if ... else if ... else

{{if a === 1}}
  ...
{{elseif b === 1}}
  ...
{{else}}
  ...
{{/if}}

3.

for

{{for i = 0; i < list.length; i ++}}
  ...
{{/for}}

each

{{each list as item , index}}
  ...
{{/each}}

4.

hack

hack

{{hack}}
  ...
{{/hack}}

5.

extends/block //smarty

{{extends parent}}
  ...
{{block block_name}}{{/block}}



{{block block_name}}
 ...
{{/block}}

6.

common.tpl

{{include common}}

NodeJS

Popular Express Projects
Popular Mvvm Projects
Popular Frameworks Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Express
Hack
Mvvm
Koa