Permalink
Browse files

Update usage example, remove non-usable regexp

  • Loading branch information...
fadrizul committed Sep 20, 2011
1 parent b23fbcd commit 1baef72392a0d63a7d4d6e08068dba9729e0f357
Showing with 9 additions and 1 deletion.
  1. +9 −0 README.md
  2. +0 −1 lib/parser.coffee
View
@@ -37,6 +37,15 @@ First we need to declare the extension of your view files. This can be anything
});
To set values for variable tags, you need to include it as options in res.render() function. In this example we're setting values for {{ name }} and {{ title }}.
+###Variables
+The application passes variables to the templates you can mess around in the template. Variables may have attributes or elements on them you can access too. How a variable looks like, heavily depends on the application providing those.
+
+You can use a dot (.) to access attributes of a variable, alternative the so-called “subscript” syntax ([]) can be used. The following lines do the same:
+
+ { foo.bar }}
+ {{ foo['bar'] }}
+*It’s important to know that the curly braces are not part of the variable but the print statement. If you access variables inside tags don’t put the braces around.
+
###Template inheritance
The most powerful part of TwigJS is template inheritance. Template inheritance allows you to build a base “skeleton” template that contains all the common elements of your site and defines blocks that child templates can override.
View
@@ -36,7 +36,6 @@ class Parser
for part in parts
if parts.hasOwnProperty(part)
parts = parts[part]
- filterName = part.match(/^\w+/)
if x.LBracket.test(part)
filters.push

0 comments on commit 1baef72

Please sign in to comment.