ZF-Commons / ZfcTwig

Zend Framework 2 Module that provides a Twig rendering strategy
BSD 3-Clause "New" or "Revised" License
96 stars 55 forks source link

nameOrModel always assumes it's an object #60

Closed keesschepers closed 11 years ago

keesschepers commented 11 years ago

When I was trying to analyze #59 I found in the following code that the function parameter nameOrModel always assumes it retrieved the view model. I am getting the error: Fatal error: Call to a member function getChildren() on a non-object.

The thing that causes is that I don't use the ZF2 built in layout system but I extend my action view:

{% extends 'layout/layout.twig' %}
{% block body %}
Dit is home :-)
{% endblock body %}

And of course in the template map layout/layout.twig exists. The page is half loading:

zfctwig

And in view/Renderer/TwigRenderer.php on line 191, there is assumed that nameOrModel is always an object, which isn't in my case.