Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fleshed out the readme file and gave it a .markdown extension so Gith…

…ub will recognize it.
  • Loading branch information...
commit 1b94c5492b05bfc33448774a9a91be128aa95475 1 parent 1edb9f3
@pmcelhaney authored
Showing with 49 additions and 4 deletions.
  1. +49 −0 readme.markdown
  2. +0 −4 readme.txt
View
49 readme.markdown
@@ -0,0 +1,49 @@
+# Mustache.cfc
+
+Chris Wantrath's [Mustache](http://mustache.github.com/) template engine for ColdFusion.
+
+## Basic Usage
+
+ <cfset template = "Hello, {{thing}}!">
+ <cfset context = structNew()>
+ <cfset context['thing'] = 'World'>
+
+ <cfouptut>#mustache.render(template, context)#</cfouptut>
+
+
+## Creating Views
+
+Given a template named Winner.mustache:
+
+ Hello {{name}}
+ You have just won ${{value}}!
+ {{#in_ca}}
+ Well, ${{taxed_value}}, after taxes.
+ {{/in_ca}}
+
+
+And a view named Winner.cfc:
+
+ <cfcomponent extends="Mustache">
+ <cffunction name="taxed_value">
+ <cfreturn this.value * 0.6>
+ </cffunction>
+ </cfcomponent>
+
+You can render the view like so:
+
+ <cfset winner = createObject("component", "Winner")>
+ <cfset winner.name = "Patrick">
+ <cfset winner.value = "1000">
+ <cfset winner.in_ca = true>
+ <cfoutput>#winner.render()#</cfoutput>
+
+Result:
+
+ Hello Patrick
+ You have just won $1000!
+ Well, $600, after taxes.
+
+
+
+
View
4 readme.txt
@@ -1,4 +0,0 @@
-## {{ mustache }} for ColdFusion
-
-A port of the Chris Wantrath's [Mustache](http://mustache.github.com/) template engine for ColdFusion.
-
Please sign in to comment.
Something went wrong with that request. Please try again.