justjohn/twig.js — Issue #15: Loosing data with functions
Author: hadrienl
Created: 2012-03-01 21:28:46+00:00
State: open

This bug is very specific. There is what I have :

- `Posts` is an array of Post objects
- `Blog.Posts()` is a method which returns an array of another Posts objects

I list them in two differents places :

{% for Post in Posts %}

{{ Post.Title}}

{% endfor %}

{% for Post in Blog.Posts(10) %}

{{ Post.Title }}

{% endfor %}

No problem with that, everything is working fine.

Now, we inverse the blocks :

{% for Post in Blog.Posts(10) %}

{{ Post.Title }}

{% endfor %}

{% for Post in Posts %}

{{ Post.Title}}

{% endfor %}

Now, the Posts block is empty. Only the

are displayed.