Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an example for info() method #6091

Merged
merged 3 commits into from
Jan 7, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions components/config/definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,34 @@ All options can be documented using the
:method:`Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition::info`
method.

.. code-block:: php

$rootNode
->children()
->inetegerNode('entries_per_page')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

integerNode has a typo 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This clearly proves that I didn't review anything when creating this PR. It's fixed now. Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

->info('This value is only used for the search results page.')
->devaultValue(25)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deFaultValue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks.

->end()
->end()
;

The info will be printed as a comment when dumping the configuration tree
with the ``config:dump-reference`` command.

In YAML you may have:

.. code-block:: yaml

# This value is only used for the search results page.
entries_per_page: 25

and in XML:

.. code-block:: xml

<!-- entries-per-page: This value is only used for the search results page. -->
<config entries-per-page="25" />

Optional Sections
-----------------

Expand Down