Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6074435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:22:53+00:00 2026-05-23T10:22:53+00:00

I am trying to learn symfony framework by creating a small project. Since I

  • 0

I am trying to learn symfony framework by creating a small project.

Since I started developing the project I have been wondering if there is a convenience function to see the contents or information of a variable or array anywherea in the application by print_r or echo or var_dump (I can use the aforesaid function straight away anywhere in the application but the output is not properly readable in case of large arrays, moreover there are warnings showin like header already sent etc. etc.).

I have also used cakePHP and it has a convenience function named pr() which prints out the contents of variable or array nicely indented (properly readable).

If I had to create such function than how can I make sure that it can be called anywhere in the application?

Any tips (links/blogs/tutorials) related to “how to debug your symfony applications” are greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:22:54+00:00Added an answer on May 23, 2026 at 10:22 am

    To put it simple: you can’t output debug “things” in your controller. The controller has nothing to do with the View (output), so when executing it does not know if there’s going to be any output.

    But, you can output debug “things” in your controller ;-)…

    • Just print_r() or var_dump(). And immediately die afterwards. That way you can see your debugging.

    • Call the logger. $this->getLogger()->debug($message);

    • Add a custom slot which you assign in your controller ($this->getResponse()->setSlot('debug', $debugData)). And include this slot somewhere in your layout file (preferably only in the dev environment.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am somewhat new to jQuery but have been having fun trying learn about
In trying to learn how to create objects in ActionScript, I have had no
Still trying to learn the basic of jquery so in the weekend I started
I am trying to learn Objective-C and have run into a problem with pushing
I'm trying to learn Symfony that requires using php in the command line /
im trying to learn some jsp as well as the spring framework. My application
Trying to learn Regex in Python to find words that have consecutive vowel-consonant or
Trying to learn a bit of CSS and I want a horizontal navbar and
I'm trying to learn C. As a C# developer, my IDE is Visual Studio.
I am trying to learn the keyboard shortcuts in Visual Studio in order to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.