Permalink
Commits on Jun 24, 2011
  1. prepare 1.1 RC3

    committed Jun 24, 2011
  2. updated CHANGELOG

    committed Jun 24, 2011
  3. merged branch jturmel/patch-1 (PR #367)

    Commits
    -------
    
    6593761 Allow setting of timezone on twig_date_format_filter method
    
    Discussion
    ----------
    
    Allow setting of timezone on twig_date_format_filter method
    committed Jun 24, 2011
Commits on Jun 22, 2011
Commits on Jun 17, 2011
  1. releasing 1.1.0 RC2

    committed Jun 17, 2011
Commits on Jun 16, 2011
  1. added Twig_Error::getRawMessage()

    committed Jun 16, 2011
  2. merged branch henrikbjorn/issue-347 (PR #348)

    Commits
    -------
    
    a8d29b1 Add testcase for issue #347
    
    Discussion
    ----------
    
    Add testcase for issue #347
    
    Dismisses false issue.
    committed Jun 16, 2011
  3. updated CHANGELOG

    committed Jun 16, 2011
  4. merged branch nikic/nestedDefinedTestWithStrictVars (PR #359)

    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 ;)
    committed Jun 16, 2011
  5. updated CHANGELOG

    committed Jun 16, 2011
  6. merged branch arnaud-lb/line-numbers (PR #353)

    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.
    committed Jun 16, 2011
Commits on Jun 14, 2011
Commits on Jun 10, 2011
Commits on Jun 9, 2011
  1. Make `a.b is defined` not throw an exception if a is not defined (in …

    …strict mode)
    nikic committed Jun 9, 2011
Commits on Jun 7, 2011
Commits on Jun 5, 2011
Commits on Jun 1, 2011
  1. Add testcase for issue #347

    henrikbjorn committed Jun 1, 2011
Commits on May 28, 2011
  1. updated VERSION

    committed May 28, 2011
  2. releasing 1.1.0 RC1

    committed May 28, 2011
  3. updated CHANGELOG

    committed May 28, 2011
  4. Merge remote branch 'tna/default-filter'

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

    …ow uses the default timezone instead of UTC to mimics the date() function behavior)
    committed May 28, 2011
Commits on May 27, 2011
  1. Date filter should treat strict integers as Unix timestamps (same as …

    …all-digit strings)
    
    
    Without a string cast, ctype_digit() will return false for an integer.
    jmikola committed May 27, 2011
Commits on May 26, 2011
  1. Fixes default filter

    tna committed May 26, 2011
Commits on May 24, 2011