When I want to modify something in the current view I have to see the action and the controller( DefaultController:indexAction
for example ) , go to the action function ( indexAction
) and see what file that action is rendering.
Is there a faster way to find out which is the file (xxxx.html.twig
) that is getting rendered in the current view ?
Somewhere in your main layout, you can add something like this :
{% if app.environment == 'dev' %}
{% block templateName %}{% endblock %}
{% endif %}
And where you want to see your layout's path, you put :
{% block templateName %}{{ _self.templateName }}{% endBlock %}
This will display the template name everywhere you want when you're in development enviornment.