Skip to content

Commit 7e33b32

Browse files
committed
minor #12958 [WebProfilerBundle] Avoid missing method when using __invoke on a controller (thewilkybarkid)
This PR was merged into the 2.6 branch. Discussion ---------- [WebProfilerBundle] Avoid missing method when using __invoke on a controller | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | 2.6 added support for using `__invoke` on controllers, but the profiler toolbar still expects a method name, leading to: ![image](https://cloud.githubusercontent.com/assets/1784740/5412993/4553c4da-820a-11e4-899c-50ef9f330cdd.png) This PR changes it to only include the method section/double dots if the method name is included (and the `link` is moved to the class name). Commits ------- fb87558 Avoid missing method when using __invoke
2 parents ea17bc7 + fb87558 commit 7e33b32

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig

+8-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
{% set request_handler %}
55
{% if collector.controller.class is defined %}
66
{% set link = collector.controller.file|file_link(collector.controller.line) %}
7-
<span class="sf-toolbar-info-class sf-toolbar-info-with-next-pointer">{{ collector.controller.class|abbr_class }}</span>
8-
<span class="sf-toolbar-info-method" onclick="{% if link %}window.location='{{link|e('js')}}';window.event.stopPropagation();return false;{% endif %}">
9-
{{ collector.controller.method }}
10-
</span>
7+
{% if collector.controller.method %}
8+
<span class="sf-toolbar-info-class sf-toolbar-info-with-next-pointer">{{ collector.controller.class|abbr_class }}</span>
9+
<span class="sf-toolbar-info-method" onclick="{% if link %}window.location='{{link|e('js')}}';window.event.stopPropagation();return false;{% endif %}">
10+
{{ collector.controller.method }}
11+
</span>
12+
{% else %}
13+
<span class="sf-toolbar-info-class" onclick="{% if link %}window.location='{{link|e('js')}}';window.event.stopPropagation();return false;{% endif %}">{{ collector.controller.class|abbr_class }}</span>
14+
{% endif %}
1115
{% else %}
1216
<span class="sf-toolbar-info-class">{{ collector.controller }}</span>
1317
{% endif %}

0 commit comments

Comments
 (0)