Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update usage example, remove non-usable regexp

  • Loading branch information...
commit 1baef72392a0d63a7d4d6e08068dba9729e0f357 1 parent b23fbcd
Fadrizul H. authored
9  README.md
Source Rendered
@@ -37,6 +37,15 @@ First we need to declare the extension of your view files. This can be anything
37 37
 	});
38 38
 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 }}.
39 39
 
  40
+###Variables
  41
+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.
  42
+
  43
+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:
  44
+
  45
+	{ foo.bar }}
  46
+	{{ foo['bar'] }}
  47
+*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.
  48
+
40 49
 ###Template inheritance
41 50
 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.
42 51
 
1  lib/parser.coffee
@@ -36,7 +36,6 @@ class Parser
36 36
         for part in parts
37 37
           if parts.hasOwnProperty(part)
38 38
             parts       = parts[part]
39  
-            filterName  = part.match(/^\w+/)
40 39
 
41 40
           if x.LBracket.test(part)
42 41
             filters.push

0 notes on commit 1baef72

Please sign in to comment.
Something went wrong with that request. Please try again.