Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Jun 17, 2011
  1. releasing 1.1.0 RC2

    authored
Commits on Jun 16, 2011
  1. merged branch henrikbjorn/issue-347 (PR #348)

    authored
    Commits
    -------
    
    a8d29b1 Add testcase for issue #347
    
    Discussion
    ----------
    
    Add testcase for issue #347
    
    Dismisses false issue.
  2. updated CHANGELOG

    authored
  3. merged branch nikic/nestedDefinedTestWithStrictVars (PR #359)

    authored
    Commits
    -------
    
    f2a1c2b Refactor and add additional default filter tests
    e760483 Make `a.b is defined` not throw an exception if a is not defined (in strict mode)
    
    Discussion
    ----------
    
    Make `a.b is defined` not throw an exception if a is not defined (in strict mode)
    
    This commit does two things: Firstly (that's the main part) it makes `a.b is defined` not throw an error in strict mode if `a` is undefined (applies for `a.b.c` aso too) [fixes #337]. Additionally it allows `a.b|default` just like it is allowed to do `a|default`.
    
    ---------------------------------------------------------------------------
    
    by fabpot at 2011/06/09 22:21:11 -0700
    
    This is quite a big change. Can you add some tests?
    
    ---------------------------------------------------------------------------
    
    by nikic at 2011/06/10 08:19:49 -0700
    
    I added some more tests for the default filter in the fixtures. But I wasn't sure how I should test the default test's behavior in strict mode. If you could point me in the right direction here I would add those tests, too ;)
  4. updated CHANGELOG

    authored
  5. merged branch arnaud-lb/line-numbers (PR #353)

    authored
    Commits
    -------
    
    5ec1955 added {% line \d+ %} directive
    
    Discussion
    ----------
    
    added {% line \d+ %} directive
    
    This directive allows to change the current line number in the tokenizer.
    
    This allows to generate Twig code from some other Twig or partially-Twig script, and still get relevant line numbers in error messages, when the line numbers of the generated Twig script do not match those of the original script.
    
    For example in the following script:
    
        foo
        {% line 10 %}
        bar
        {{ baz }}
    
    `"foo"` is on line 1, `"bar"` is considered to be on line 10 and `{{ baz }}` is considered to be on line 11.
    
    This is similar to `# line ...` directives in C.
    
    ---------------------------------------------------------------------------
    
    by nikic at 2011/06/05 08:51:20 -0700
    
    I don't quite yet understand it's use cases.
    
    ---------------------------------------------------------------------------
    
    by arnaud-lb at 2011/06/05 09:17:57 -0700
    
    The `{% line ... %}` directive is not meant to be used by humans, but rather by generators.
    
    The use case is the same as [#line directives in C](http://gcc.gnu.org/onlinedocs/cpp/Line-Control.html): when you generate a C file from a template, you would prefer that the compiler refers to the line number of the template, instead of the line number of the generated file.
    
    In my case, I built a [HAML compiler for php](https://github.com/arnaud-lb/MtHaml) which can target Twig as an output language. I use it as a Twig pre-processor so that it translates HAML scripts to Twig scripts on the fly in a custom Twig_Loader.
    
    So I have scripts like that:
    
        %p
          test
        %div = foo.bar
    
    which is compiled like that:
    
        <p>
          test
        </p>
        <div>
           {{ foo.bar }}
        </div>
    
    If an error occurs in the execution of {{ foo.bar }}, Twig will throw an error refering to line 5 in the original script, which is wrong. A simple solution to this is the {% line %} directive:
    
        <p>
          test
        </p>
        <div>
        {% line 3 %}
           {{ foo.bar }}
        </div>
    
    Now if an error occures in {{ foo.bar }}, the error will refer to line 3.
    
    ---------------------------------------------------------------------------
    
    by nikic at 2011/06/05 09:33:26 -0700
    
    Ah, okay, seems reasonable. Though I'm not sure whether it is appropriate to use the comment syntax to accomplish that.
    
    ---------------------------------------------------------------------------
    
    by arnaud-lb at 2011/06/05 10:41:03 -0700
    
    You are right, I changed the request to use the block syntax instead.
Commits on Jun 14, 2011
Commits on Jun 10, 2011
Commits on Jun 9, 2011
Commits on Jun 7, 2011
Commits on Jun 5, 2011
  1. @arnaud-lb
Commits on Jun 1, 2011
  1. @henrikbjorn

    Add testcase for issue #347

    henrikbjorn authored
Commits on May 28, 2011
  1. updated VERSION

    authored
  2. releasing 1.1.0 RC1

    authored
  3. updated CHANGELOG

    authored
  4. Merge remote branch 'tna/default-filter'

    authored
    * tna/default-filter:
      Moved default filter fix to its proper place
      Fixes default filter
  5. fixed timezone when using the date filter with a UNIX timestamp (it n…

    authored
    …ow uses the default timezone instead of UTC to mimics the date() function behavior)
Commits on May 27, 2011
  1. @jmikola

    Date filter should treat strict integers as Unix timestamps (same as …

    jmikola authored
    …all-digit strings)
    
    
    Without a string cast, ctype_digit() will return false for an integer.
Commits on May 26, 2011
  1. @tna
  2. @tna

    Fixes default filter

    tna authored
Commits on May 24, 2011
Commits on May 20, 2011
  1. @brikou

    fixed constructor + cosmetic

    brikou authored
Commits on May 18, 2011
  1. tweaked docs

    authored
  2. Add some further is defined unit tests and give clearer names

    nikic authored committed
  3. Fix regression in defined test for GetAttr. Fixes #319

    nikic authored committed
  4. Merge remote branch 'jpb0104/master'

    authored
    * jpb0104/master:
      Added an example of escaped "at" in a date filter.
Commits on May 17, 2011
  1. @jpb0104
Commits on May 10, 2011
  1. simplified code

    authored
Commits on May 9, 2011
  1. added a test for the raw tag

    authored
  2. moved a test

    authored
  3. fixed parsing problem when a large chunk of text is enclosed in a raw…

    authored
    … tag
    
    This is a quick and ugly fix... This should be refactored later on
Something went wrong with that request. Please try again.