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

dump in volt

Hi brothers!!! Before {{dump(anyvar)}}, it was beautiful, and now it shows everything in one line. What happened? How can I reverse the output of a dump?



58.1k

You can replace built-in function dump:

$compiler->addFunction("dump", "print_r");

https://docs.phalcon.io/en/latest/reference/volt.html#id1



85.5k

i usually debug mine with

<?php

echo "<pre>"; var_dump($var); exit; ?>

in the middle of my volt code



43.9k

@syurmol : really ? I will give it a try right now !!!



43.9k

well, nothing special for me, it looks like usual ...



3.4k

What version of Phalcon are you using @syrmol



14.4k

The version worked well for 3.0.0 in my home book But installed on server 3.1.1. it began to write all in one line Strange ...



85.5k

can you post a screenshot

also this can be done by html itself if you wrap the dump in div with overflow Y potentionally it should look ugly :D

xdebug is responsible for coloured dumps, make sure you have it installed and enabled. https://xdebug.org/docs/display



14.4k

Thank you very match