fabpot/Twig — Issue #485: "defined" test is returning wrong result
Author: fernanDOTdo
Created: 2011-10-26 14:47:31+00:00
State: open

Hi!
I dont know exactly why, but the "defined" test is returning wrong result, at least in this case:

In the file vendor/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig, in line 9 we have this test:

{% if collector.controller.class is defined %}
{{ collector.controller.class|abbr_class }}
::
{% set link = collector.controller.file|file_link(collector.controller.line) %}
{% if link %}{{ collector.controller.method }}{% else %}{{ collector.controller.method }}{% endif %}
{% else %}
{{ collector.controller }}
{% endif %}

This is my Toolbar: http://i.imgur.com/aC1v6.png

You can see that my "{% if collector.controller.class is defined %}" returns false in this case, but this is the debug for collector.controller:

array
'class' =>string 'Mastop\TestBundle\Controller\TestController'
'method' =>string 'indexAction'
'file' =>string '/home/nginx/symfony-standard/src/Mastop/TestBundle/Controller/TestController.php'
'line' =>int 18

Thank you,
Fernando