From e22f0157ebf062761b6e53b8ea8218646e328150 Mon Sep 17 00:00:00 2001 From: lajosthiel Date: Tue, 24 Nov 2020 19:09:08 +0100 Subject: [PATCH] [Serializer] Clarifies 'csv_headers' option --- components/serializer.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/serializer.rst b/components/serializer.rst index 5c498cbf593..35526432694 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -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