rcrowe/TwigBridge — pull request #8 by jtboofle (2013-01-15 19:28:40+00:00)
Title: Kludgy fix for handling Eloquent relations

If a User has many Pages, these should work:

{% for user in users %}

{{user.display_name}} - {{user.pages}}

{% endfor %}

{% for user in users %}

{{user.display_name}}

{% for page in user.pages %}
{{page.title}}
{% endfor %}
{% endfor %}

But they currently throw an exception: "Object of class Illuminate\Database\Eloquent\Relations\HasMany could not be converted to string"

This commit creates a new EloquentTemplate that checks to see if we have a Relation coming back from an {{object.property}} style evaluation and if we do, returns the data instead of the relation.