Skip to content

Commit 2e69b0b

Browse files
committed
Fixed a Serializer example
1 parent ab238c7 commit 2e69b0b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/serializer.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,9 +843,10 @@ Option Description De
843843
``csv_key_separator`` Sets the separator for array's keys during its ``.``
844844
flattening
845845
``csv_headers`` Sets the order of the header and data columns
846-
E.g.: ``serialize(['c' => 3,'a' => 1,'b' => 2],
847-
'csv', ['csv_headers' => ['a', 'b', 'c']]);``
848-
returns ``a,b,c\n1,2,3 `` ``[]``, inferred from input data's keys
846+
E.g.: if ``$data = ['c' => 3, 'a' => 1, 'b' => 2]``
847+
and ``$options = ['csv_headers' => ['a', 'b', 'c']]``
848+
then ``serialize($data, 'csv', $options)`` returns
849+
``a,b,c\n1,2,3 `` ``[]``, inferred from input data's keys
849850
``csv_escape_formulas`` Escapes fields containg formulas by prepending them ``false``
850851
with a ``\t`` character
851852
``as_collection`` Always returns results as a collection, even if only

0 commit comments

Comments
 (0)