Skip to content

Add documentation for XmlEncoder context param #7231

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

Closed

Conversation

amoiraud
Copy link
Contributor

@amoiraud amoiraud commented Dec 7, 2016

Add documentation for XmlEncoder context param

Related to : symfony/symfony#20524
This fixes #7227

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

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

👍

@amoiraud thanks for providing this doc!

The array keys beginning with ``@`` are considered XML attributes::

$encoder = new XmlEncoder();
$encoder->encode(array('foo' => array('@bar' => 'value')));
Copy link
Member

Choose a reason for hiding this comment

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

the XmlEncoder class won't be called directly. It will be called when using $serializer->serialize($data, 'xml', $context)

``xml_root_node_name``
  Change the root node name (default: ``response``).

``remove_empty_tags``
Copy link
Member

Choose a reason for hiding this comment

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

Context options related to the XML encoder should not be documented in the main chapter of the serializer doc IMO (but this should be decided by the doc team).
And if we document them (which is a good idea), context options supported by encoders for other formats should be documented too.

@xabbuh
Copy link
Member

xabbuh commented Jan 10, 2017

@amoiraud Sorry for the delay here. Do you think you can address @stof's comments or should we take care of them when merging?

Status: Needs work

@amoiraud
Copy link
Contributor Author

Hi @xabbuh !

If you can take care of them when merging that would be great, I'm not really fluent in english :/

Thanks

@javiereguiluz
Copy link
Member

Thanks!

@javiereguiluz javiereguiluz added this to the 3.3 milestone Jan 5, 2018
javiereguiluz added a commit that referenced this pull request Jan 5, 2018
… javiereguiluz)

This PR was submitted for the master branch but it was merged into the 3.3 branch instead (closes #7231).

Discussion
----------

Add documentation for XmlEncoder context param

Add documentation for XmlEncoder context param

Related to : symfony/symfony#20524
This fixes #7227

Commits
-------

5e23045 Minor tweaks
adbc7b2 Minor rewords
2dc6ed3 Minor syntax issue
6050370 Minor syntax issues and some rewordings
2f3cf02 Correcting my bad english with a bilingual friend
60c7657 Add XmlEncoder documentation with $context available options
04af434 erratum
c83e59d Add XmlEncoder documentation with $context available options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Serializer] Add documentation for "Allow removing empty tags in generated XML"
5 participants