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?

You can replace built-in function dump:

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

https://docs.phalconphp.com/en/latest/reference/volt.html#id1



64.0k

i usually debug mine with

<?php

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

in the middle of my volt code



30.7k

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



30.7k

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



3.0k

What version of Phalcon are you using @syrmol



4.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 ...



64.0k

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