@@ -23,11 +23,8 @@ You can install the component in 2 different ways:
2323The dump() function
2424-------------------
2525
26- The VarDumper component creates a global ``dump() `` function that is
27- configured out of the box: HTML or CLI output is automatically selected based
28- on the current PHP SAPI.
29-
30- The advantages of this function are:
26+ The VarDumper component creates a global ``dump() `` function that you can
27+ use instead of e.g. :phpfunction: `var_dump `. By using it, you'll gain:
3128
3229- per object and resource types specialized view to e.g. filter out
3330 Doctrine internals while dumping a single proxy entity, or get more
@@ -47,44 +44,67 @@ You can change the behavior of this function by calling
4744:method: `VarDumper::setHandler($callable) <Symfony\\ Component\\ VarDumper\\ VarDumper::setHandler> `:
4845calls to ``dump() `` will then be forwarded to ``$callable ``.
4946
50- Where does the output go?
51- -------------------------
47+ Output format and destination
48+ -----------------------------
5249
53- If you read the advanced documentation, you'll learn how to change the
54- format or redirect the output to wherever you want.
50+ If you read the ` advanced documentation <advanced> ` , you'll learn how to
51+ change the format or redirect the output to wherever you want.
5552
5653By default, these are selected based on your current PHP SAPI:
5754
58- - on the command line (CLI SAPI), the output is written on `STDERR `. This
55+ - on the command line (CLI SAPI), the output is written on `` STDERR ` `. This
5956 can be surprising to some because this bypasses PHP's output buffering
60- mechanism. On the other hand, this give the possibility to easily split
57+ mechanism. On the other hand, it give the possibility to easily split
6158 dumps from regular output by using pipe redirection.
6259- on other SAPIs, dumps are written as HTML on the regular output.
6360
6461DebugBundle and Twig integration
6562--------------------------------
6663
67- The `DebugBundle ` allows greater integration of the component into the
64+ The `` DebugBundle ` ` allows greater integration of the component into the
6865Symfony full stack framework. It is enabled by default in the dev
6966environement of the standard edition since version 2.6.
7067
7168Since generating (even debug) output in the controller or in the model
7269of your application may just break it by e.g. sending HTTP headers or
73- corrupting your view, the bundle configures the `dump() ` function so that
70+ corrupting your view, the bundle configures the `` dump() ` ` function so that
7471variables are dumped in the web debug toolbar.
7572
76- But if the toolbar can not be displayed because you e.g. called `die `/` exit `
73+ But if the toolbar can not be displayed because you e.g. called `` die ``/`` exit ` `
7774or a fatal error occurred, then dumps are written on the regular output.
7875
7976In a Twig template, two constructs are available for dumping a variable.
80- Choosing between both is generally only a matter of personal taste:
77+ Choosing between both is mostly a matter of personal taste, still :
8178
82- - `{% dump foo.bar %} ` is the way to go when the original template output
79+ - `` {% dump foo.bar %} ` ` is the way to go when the original template output
8380 shall not be modified: variables are not dumped inline, but in the web
8481 debug toolbar.
85- - on the contrary, `{{ dump(foo.bar) }} ` dumps inline and thus may or not
82+ - on the contrary, `` {{ dump(foo.bar) }} ` ` dumps inline and thus may or not
8683 be suited to your use case (e.g. you shouldn't use it in an HTML
87- attribute or a `script ` tag).
84+ attribute or a ``<script> `` tag).
85+
86+ By default for nested variables, dumps are limited to a subset of their
87+ original value. You can configure the limits in terms of:
88+ - maximum number of items to dump,
89+ - maximum string length before truncation.
90+
91+ .. configuration-block ::
92+
93+ .. code-block :: yaml
94+
95+ debug :
96+ max_items : 250
97+ max_string_length : -1
98+
99+ .. code-block :: xml
100+
101+ <?xml version =" 1.0" encoding =" UTF-8" ?>
102+ <container xmlns =" http://symfony.com/schema/dic/debug"
103+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
104+ xsi : schemaLocation =" http://symfony.com/schema/dic/debug http://symfony.com/schema/dic/debug/debug-1.0.xsd" >
105+
106+ <config max-items =" 250" max-string-length =" -1" />
107+ </container >
88108
89109 Reading a dump
90110--------------
0 commit comments