Skip to content

[Serializer] Clarifies 'csv_headers' option #14609

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
Jan 8, 2021
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
9 changes: 8 additions & 1 deletion components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,14 @@ Option Description De
``csv_escape_char`` Sets the escape character (at most one character)
``csv_key_separator`` Sets the separator for array's keys during its ``.``
flattening
``csv_headers`` Sets the headers for the data ``[]``, inferred from input data's keys
``csv_headers`` Sets the order of the header and data columns
E.g.: $this->serializer->serialize(
['c' => 3,'a' => 1,'b' => 2],
'csv',
['csv_headers' => ['a', 'b', 'c']]);
returns
a,b,c
1,2,3 ``[]``, inferred from input data's keys
``csv_escape_formulas`` Escapes fields containg formulas by prepending them ``false``
with a ``\t`` character
``as_collection`` Always returns results as a collection, even if only
Expand Down