Skip to content

Commit 350e0c7

Browse files
split intro/advanced sections
1 parent 036edcb commit 350e0c7

File tree

5 files changed

+64
-52
lines changed

5 files changed

+64
-52
lines changed

components/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The Components
2929
stopwatch
3030
templating/index
3131
translation/index
32-
var_dumper
32+
var_dumper/index
3333
yaml/index
3434

3535
.. include:: /components/map.rst.inc

components/map.rst.inc

+3-2
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@
143143
* :doc:`/components/translation/usage`
144144
* :doc:`/components/translation/custom_formats`
145145

146-
* **VarDumper**
146+
* :doc:`/components/var_dumper/index`
147147

148-
* :doc:`/components/var_dumper`
148+
* :doc:`/components/var_dumper/introduction`
149+
* :doc:`/components/var_dumper/advanced`
149150

150151
* :doc:`/components/yaml/index`
151152

components/var_dumper.rst renamed to components/var_dumper/advanced.rst

+2-49
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,8 @@
22
single: VarDumper
33
single: Components; VarDumper
44

5-
The VarDumper Component
6-
=======================
7-
8-
The VarDumper component provides mechanisms for walking through any
9-
arbitrary PHP variable. Built on top, it provides a better ``dump()``
10-
function that you can use instead of :phpfunction:`var_dump`.
11-
12-
.. versionadded:: 2.6
13-
The VarDumper component was introduced in Symfony 2.6.
14-
15-
Installation
16-
------------
17-
18-
You can install the component in 2 different ways:
19-
20-
- :doc:`Install it via Composer </components/using_components>` (``symfony/var-dumper`` on `Packagist`_);
21-
- Use the official Git repository (https://github.com/symfony/var-dumper).
22-
23-
The dump() function
24-
-------------------
25-
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:
31-
32-
- per object and resource types specialized view to e.g. filter out
33-
Doctrine internals while dumping a single proxy entity, or get more
34-
insight on opened files with :phpfunction:`stream_get_meta_data()`.
35-
- configurable output formats: HTML or colored command line output.
36-
- ability to dump internal references, either soft ones (objects or
37-
resources) or hard ones (``=&`` on arrays or objects properties).
38-
Repeated occurrences of the same object/array/resource won't appear
39-
again and again anymore. Moreover, you'll be able to inspect the
40-
reference structure of your data.
41-
- ability to operate in the context of an output buffering handler.
42-
43-
``dump()`` is just a thin wrapper for
44-
:method:`VarDumper::dump() <Symfony\\Component\\VarDumper\\VarDumper::dump>`
45-
so can you also use it directly.
46-
You can change the behavior of this function by calling
47-
:method:`VarDumper::setHandler($callable) <Symfony\\Component\\VarDumper\\VarDumper::setHandler>`:
48-
calls to ``dump()`` will then be forwarded to ``$callable``, given as first argument.
49-
50-
Advanced Usage
51-
--------------
5+
Advanced Usage of the VarDumper Component
6+
=========================================
527

538
Cloners
549
~~~~~~~
@@ -201,5 +156,3 @@ method. They also typically implement the
201156
:class:`Symfony\\Component\\VarDumper\\Cloner\\DumperInterface` that frees
202157
them from re-implementing the logic required to walk through a
203158
:class:`Symfony\\Component\\VarDumper\\Cloner\\Data` object's internal structure.
204-
205-
.. _Packagist: https://packagist.org/packages/symfony/var-dumper

components/var_dumper/index.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
VarDumper
2+
=========
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
7+
introduction
8+
advanced
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
.. index::
2+
single: VarDumper
3+
single: Components; VarDumper
4+
5+
The VarDumper Component
6+
=======================
7+
8+
The VarDumper component provides mechanisms for walking through any
9+
arbitrary PHP variable. Built on top, it provides a better ``dump()``
10+
function that you can use instead of :phpfunction:`var_dump`.
11+
12+
.. versionadded:: 2.6
13+
The VarDumper component was introduced in Symfony 2.6.
14+
15+
Installation
16+
------------
17+
18+
You can install the component in 2 different ways:
19+
20+
- :doc:`Install it via Composer </components/using_components>` (``symfony/var-dumper`` on `Packagist`_);
21+
- Use the official Git repository (https://github.com/symfony/var-dumper).
22+
23+
The dump() function
24+
-------------------
25+
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:
31+
32+
- per object and resource types specialized view to e.g. filter out
33+
Doctrine internals while dumping a single proxy entity, or get more
34+
insight on opened files with :phpfunction:`stream_get_meta_data()`.
35+
- configurable output formats: HTML or colored command line output.
36+
- ability to dump internal references, either soft ones (objects or
37+
resources) or hard ones (``=&`` on arrays or objects properties).
38+
Repeated occurrences of the same object/array/resource won't appear
39+
again and again anymore. Moreover, you'll be able to inspect the
40+
reference structure of your data.
41+
- ability to operate in the context of an output buffering handler.
42+
43+
``dump()`` is just a thin wrapper for
44+
:method:`VarDumper::dump() <Symfony\\Component\\VarDumper\\VarDumper::dump>`
45+
so can you also use it directly.
46+
You can change the behavior of this function by calling
47+
:method:`VarDumper::setHandler($callable) <Symfony\\Component\\VarDumper\\VarDumper::setHandler>`:
48+
calls to ``dump()`` will then be forwarded to ``$callable``, given as first argument.
49+
50+
.. _Packagist: https://packagist.org/packages/symfony/var-dumper

0 commit comments

Comments
 (0)