Skip to content

Commit e22f015

Browse files
lajosthieljaviereguiluz
authored andcommitted
[Serializer] Clarifies 'csv_headers' option
1 parent 9357aba commit e22f015

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

components/serializer.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,14 @@ Option Description De
842842
``csv_escape_char`` Sets the escape character (at most one character)
843843
``csv_key_separator`` Sets the separator for array's keys during its ``.``
844844
flattening
845-
``csv_headers`` Sets the headers for the data ``[]``, inferred from input data's keys
845+
``csv_headers`` Sets the order of the header and data columns
846+
E.g.: $this->serializer->serialize(
847+
['c' => 3,'a' => 1,'b' => 2],
848+
'csv',
849+
['csv_headers' => ['a', 'b', 'c']]);
850+
returns
851+
a,b,c
852+
1,2,3 ``[]``, inferred from input data's keys
846853
``csv_escape_formulas`` Escapes fields containg formulas by prepending them ``false``
847854
with a ``\t`` character
848855
``as_collection`` Always returns results as a collection, even if only

0 commit comments

Comments
 (0)