17

When I render a template and return a Response from a Controller, there is a nice Web Debug Toolbar on the bottom of the page.

Is it possible to make this bar appear when I don't use template and return a response by creating a Response object myself?

1 Answer 1

32

It should be sufficient to make sure there is a valid <body>...</body>-block contained in the response-HTML-code. if the body-section is missing, then the debug toolbar won't appear.

Sign up to request clarification or add additional context in comments.

4 Comments

sometimes when you do plain Responses without rendering a template, you don't send valid HTML.. So for me what fixed it was rendering a template
Amazing! They probably didn't want to break JSON/XML etc responses in dev environment by including toolbar into them! Thanks a lot for this!
This bugged me for over two years now. Nice to know, thank you!
Worth mentioning that you can also access the toolbar for JSON/XML (non-html) responses: stackoverflow.com/a/34810937/330267

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.