Commits
-------
930330f Allow defined test and default filter on methods
Discussion
----------
Allow defined test and default filter on methods
Patch for #487.
---------------------------------------------------------------------------
by fabpot at 2011/10/30 03:45:49 -0700
Problem is when some of the arguments reference variables that do not exist (`foo.bar(bar.foobar)`). That's why I've added the check on arguments.
---------------------------------------------------------------------------
by nikic at 2011/10/30 03:58:58 -0700
@fabpot I'm not exactly sure what is the expected behavior in that case. When writing `foo.defined(undefined)|default()` I think an exception is the expected behavior (because there is an undefined variable without default, even if it is in the method arguments). With `foo.undefined(undefined)|default()` on the other hand I'm not sure. One could argue that as the method does not exist the arguments never need to be evaluated.
---------------------------------------------------------------------------
by fabpot at 2011/10/30 05:49:46 -0700
The same code is used for the `defined` test: what would be the expected behavior for `foo.defined(underfined) is defined`?
Commits
-------
7da9f2f Make long var/block tests faster
Discussion
----------
Make long var/block tests faster
When using `*` every single character is a different token, whereas with `x` there is only a single token. I don't think this hurts the actual test, but it improves the test runtime by something like 2/3 seconds on my machine.
Commits
-------
2ebc788 Update extension docs and interface
Discussion
----------
Update extension docs and interface
Followup to #484: Twig isn't using globals for functions anymore.
Commits
-------
389f2c2 Changed mode from 0755 to 0644
c48bd2f Fixed wrong used PHPDoc tags
Discussion
----------
Fixed wrong used PHPDoc tags
@param was used instead of @return
---------------------------------------------------------------------------
by fabpot at 2011/10/25 05:47:59 -0700
Can you revert the mode change (from 0644 to 0755)?
Commits
-------
c91357d Moved interfaces
Discussion
----------
Moved interfaces
The Countable and IteratorAggregate interfaces have to be part of the Twig_NodeInterface as the Twig_NodeInterface is used as a typehint and the function tries to iterate over its elements.
E.g:
Twig_NodeTraverser::traverseForVisitor
foreach ($node as $k => $n)
Commits
-------
cf03a65 add another example add another example to constant.rst
Discussion
----------
add another example
An example for using the `constant` function
---------------------------------------------------------------------------
by yegeniy at 2011/10/19 09:48:37 -0700
Should be ready.
---------------------------------------------------------------------------
by nikic at 2011/10/19 10:58:01 -0700
I think you should just add that as a line to the other example, so you got this in the end:
```rst
``constant``
============
``constant`` returns the constant value for a given string:
.. code-block:: jinja
{{ some_date|date(constant('DATE_W3C')) }}
{{ constant('Namespace\\Classname::CONSTANT_NAME') }}
```
---------------------------------------------------------------------------
by fabpot at 2011/10/21 07:24:32 -0700
That's indeed a good addition to the doc. Can you squash your commits in to one before I merge this pull request? Thanks.
---------------------------------------------------------------------------
by yegeniy at 2011/10/22 06:28:58 -0700
Thanks!