Permalink
Switch branches/tags
Commits on Feb 29, 2012
  1. prepared the 1.6.1 release

    fabpot committed Feb 29, 2012
Commits on Feb 28, 2012
  1. fixed Twig C extension

    fabpot committed Feb 28, 2012
  2. fixed CS

    fabpot committed Feb 28, 2012
  3. added some unit tests

    fabpot committed Feb 28, 2012
Commits on Feb 21, 2012
Commits on Feb 19, 2012
  1. Revert "merged branch m0ppers/master (PR #611)"

    fabpot committed Feb 19, 2012
    This reverts commit 5f4e6d7, reversing
    changes made to a61d420.
Commits on Feb 18, 2012
  1. updated CHANGELOG

    fabpot committed Feb 18, 2012
  2. merged branch m0ppers/master (PR #611)

    fabpot committed Feb 18, 2012
    Commits
    -------
    
    71449e8 Remove optimization (covered by Optimization VAR_ACCESS anyway)
    
    Discussion
    ----------
    
    Remove optimization (covered by Optimization VAR_ACCESS anyway)
    
    I have an own template class implementing getContext() and this one drove me completely mad after a twig upgrade.
    
    After compilation the resulting templates have:
    
    isset($context['bla'])
    
    vs.
    
    $this->getContext('bla')
    
    Changing the Name Node however didn't have any effect and i saw that due to the optimizations by the SetTemp class twig doesn't even reach the Name Node. In fact SetTemp has the isset optimization hardcoded (which is ok).
    
    I could simply fix my issue by setting optimizations to -9 (all optimizations except VAR_ACCESS). However the issue will reappear immediately when using PHP 5.4. Please remove the isset stuff from the non optimized node and let the optimization handler handle it (which i would disable in my case)
    
    ---------------------------------------------------------------------------
    
    by m0ppers at 2012-01-24T17:42:07Z
    
    some hackish script to test what i mean
    
    <?php
    require 'lib/Twig/Autoloader.php';
    Twig_Autoloader::register();
    
    abstract class Harxtemplate extends Twig_Template
    {
        public function getContext($context, $item, $ignoreStrictCheck = false)
        {
            if ($item == "hans") {
                return "hund";
            } else {
                return parent::getContext($context, $item, $ignorStrictCheck);
            }
        }
    }
    
    $template = <<<EOT
    Der {{ hans }} hat hund
    {% if hans %}
    hund
    {% endif %}
    EOT;
    
    $loader = new Twig_Loader_String();
    $options = array('base_template_class' => 'Harxtemplate',
    //                 'strict_variables' => true, // doesn't work
                     'debug' => true,
                     'optimizations' => -1, // 0 => works
                    );
    $twig = new Twig_Environment($loader, $options);
    
    echo $twig->render($template);
  3. merged branch mvrhov/patch-1 (PR #603)

    fabpot committed Feb 18, 2012
    Commits
    -------
    
    95f8af7 cast $name to a string as $name can in fact be an object implementing __toString function as true in my case.
    
    Discussion
    ----------
    
    cast $name to a string ...
    
    ... because $name can be an object implementing __toString. I have Enum type implementation which implements __toString. Without the cast I'm getting the following exception:
    "An exception has been thrown during the rendering of a template ("Warning: Illegal offset type in isset or empty in... "
    
    ---------------------------------------------------------------------------
    
    by fabpot at 2012-01-18T08:43:23Z
    
    From where do you call these methods? from your code? from a template?
    
    ---------------------------------------------------------------------------
    
    by mvrhov at 2012-01-18T11:17:55Z
    
    I put the enum object as variable into the template and then based on the enum value I display a block.
  4. updated CHANGELOG

    fabpot committed Feb 18, 2012
  5. merged branch Seldaek/markup (PR #638)

    fabpot committed Feb 18, 2012
    Commits
    -------
    
    e4590d0 Avoid creating unnecessary Twig_Markup instances, allows testing for falsiness of empty output
    
    Discussion
    ----------
    
    Avoid creating unnecessary Twig_Markup instances
    
    This allows testing for falsiness of an empty output:
    
    ```jinja
    {% set foo %}{% block lala %}{% endblock %}{% endset %}
    
    {% if foo %}
       some output with {{ foo }}
    {% endif %}
    ```
    
    Currently this requires `{% if foo|length %}` since the set tag will always return a Twig_Markup.
Commits on Feb 17, 2012
  1. Avoid creating unnecessary Twig_Markup instances, allows testing for …

    Seldaek committed Feb 17, 2012
    …falsiness of empty output
  2. added phpdoc (closes #627)

    fabpot committed Feb 17, 2012
Commits on Feb 15, 2012
  1. fixed previous merge

    fabpot committed Feb 15, 2012
  2. merged branch mlehner/default_timezone (PR #635)

    fabpot committed Feb 15, 2012
    Commits
    -------
    
    5699753 added setTimezone to allow globally overriding the timezone when formating dates
    
    Discussion
    ----------
    
    Allow setting global timezone for date formatting
    
    My API returns dates in a string format of 2012-02-14T00:35:37+00:00. When parsed by the DateTime constructor, the timezone for that new object is UTC. Without specifying every time I use the date filter there was no way to globally influence the timezone used.
    
    I added setTimezone() to the core extension that functions similar to setDateFormat() except that there is no timezone set by default to allow for backwards compatibility.
Commits on Feb 14, 2012
  1. added setTimezone to allow globally overriding the timezone when form…

    Matt Lehner
    Matt Lehner committed Feb 14, 2012
    …ating dates
Commits on Feb 12, 2012
  1. merged branch webwizard/patch-1 (PR #628)

    fabpot committed Feb 12, 2012
    Commits
    -------
    
    904dfef fixed typo
    
    Discussion
    ----------
    
    fixed typo
  2. fixed typo

    viczam committed Feb 12, 2012
Commits on Feb 6, 2012
  1. updated CHANGELOG

    fabpot committed Feb 6, 2012
  2. fixes CS

    fabpot committed Feb 6, 2012
  3. merged branch sv1l/master (PR #623)

    fabpot committed Feb 6, 2012
    Commits
    -------
    
    b6007f1 Fixed slice filter w/ null length for string values
    
    Discussion
    ----------
    
    Fixed issue #622: strings slice filter w/ no length
    
    Fixed issue [#622](https://github.com/fabpot/Twig/issues/622)
Commits on Feb 5, 2012
  1. Fixed slice filter w/ null length for string values

    Sylvain Dethier
    Sylvain Dethier committed Feb 5, 2012
Commits on Feb 4, 2012
  1. bumped version to 1.7.0-DEV

    fabpot committed Feb 4, 2012
  2. prepared the 1.6.0 release

    fabpot committed Feb 4, 2012
Commits on Jan 31, 2012
  1. added missing entry in the doc

    fabpot committed Jan 31, 2012
Commits on Jan 28, 2012