Skip to content

Instantly share code, notes, and snippets.

@fschwiet
Created July 26, 2010 02:18
Show Gist options
  • Save fschwiet/490094 to your computer and use it in GitHub Desktop.
Save fschwiet/490094 to your computer and use it in GitHub Desktop.
Writing blocks of code:
${EXPR} => write result of expression as encoded string
!{EXPR} => write result of expression as unencoded string
[[,]] => <, > (when in a codeblock outside a string literal, used for generics)
'string' => "string" (when in a codeblock)
<use namespace="..."/>
Manipulating variables:
<var NAME="EXPR" [type="TYPE"] />
<var ...>
... limited scope for var
</var>
<set NAME="EXPR"/>
Viewdata:
<viewdata NAME="TYPE"/>
Conditionals:
<if condition="CONDITIONAL"></if>
<else condition="CONDITIONAL"></if>
<div if="CONDITIONAL"></div>
<div elseif="condition"></div>
<div class="empty?{CONDITIONAL}"/>
<input type="checkbox" checked="checked?{CONDITIONAL}"/>
Loops:
<for each="var v in collection">
... code blocks can use additional values: v.Index, v.Count, v.IsFirst, v.IsLast
</for>
<div each="var v in collection">
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment