We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to debug data on particular variable inside in controller.

How can i know or how can i debug data reside on variable in phalcon version 3.1.2.

edited Jun '20

I assume you're trying to echo it and you're not seeing it on the screen? That's because Phalcon buffers all output. After you echo the variable, you can call ob_flush() or, what I often do, exit().

I've also personally used Tracy: https://tracy.nette.org/ and it has a bd_dump() function that lets you log stuff to an error console you can access from the page.

Yeah i do same exit; :)



4.2k

Instead of stopping on exit, I write this in the view for that action:

{{ content() }}

(I mainly use volt)



1.1k

I use phalcon-debugbar to debug the code, and I am very happy with it

https://github.com/snowair/phalcon-debugbar

I use xdebug.