Skip to content

Commit

Permalink
Update usage example, remove non-usable regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
fadrizul committed Sep 20, 2011
1 parent b23fbcd commit 1baef72
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -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.

Expand Down
1 change: 0 additions & 1 deletion lib/parser.coffee
Expand Up @@ -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
Expand Down

0 comments on commit 1baef72

Please sign in to comment.