Skip to content

[Components][Form] add versionadded for the data collector form extension #3887

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

Merged
merged 1 commit into from
Jun 7, 2014
Merged
Changes from all commits
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
6 changes: 6 additions & 0 deletions components/form/form_events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ the form.

.. sidebar:: ``FormEvents::POST_SET_DATA`` in the Form component

.. versionadded:: 2.4
The data collector extension was introduced in Symfony 2.4.
Copy link
Member

Choose a reason for hiding this comment

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

will this work? Maybe it's nicer if we placed this before the sidebar directive

Copy link
Member Author

Choose a reason for hiding this comment

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

In the default Sphinx template it does work. Placing it outside the sidebar directive is no option because you wouldn't know where it would actually be rendered then.

Copy link
Member Author

Choose a reason for hiding this comment

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

@javiereguiluz What do think?

Copy link
Member

Choose a reason for hiding this comment

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

@xabbuh you are right about being better to place the versionadded directive inside the sidebar.

The problem is that I don't know how to do it. I find Sphinx absurdly complex and the Python/Sphinx community doesn't help us. Take for example the question about adding titles inside the sidebars. We asked for help on GitHub, Twitter and even on the official Shpinx user group. No one helped us.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there really anything special for you to do? I mean, using the default Sphinx template causes no problems. So, what I was wondering about was if there is something for you to do in the template. Or if this just rendered smoothly.

Copy link
Member

Choose a reason for hiding this comment

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

@xabbuh this is the code we use to render sidebars:

    def visit_sidebar(self, node):
        self.body.append(self.starttag(node, 'div', CLASS=('admonition-wrapper')))
        self.body.append('<div class="sidebar"></div>')
        self.body.append('<div class="admonition admonition-sidebar">')
        self.set_first_last(node)
        self.in_sidebar = 1

    def depart_sidebar(self, node):
        self.body.append('</div></div>\n')
        self.in_sidebar = None

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems to be valid. I guess we can just try this out and have a look what it looks like when this is built.


The :class:`Symfony\\Component\\Form\\Extension\\DataCollector\\EventListener\\DataCollectorListener`
class is subscribed to listen to the ``FormEvents::POST_SET_DATA`` event
in order to collect information about the forms from the denormalized
Expand Down Expand Up @@ -218,6 +221,9 @@ It can be used to fetch data after denormalization.

.. sidebar:: ``FormEvents::POST_SUBMIT`` in the Form component

.. versionadded:: 2.4
The data collector extension was introduced in Symfony 2.4.

The :class:`Symfony\\Component\\Form\\Extension\\DataCollector\\EventListener\\DataCollectorListener`
subscribes to the ``FormEvents::POST_SUBMIT`` event in order to collect
information about the forms.
Expand Down