|
11 | 11 | /** |
12 | 12 | * A view class that is used for CSV responses. |
13 | 13 | * |
14 | | - * By setting the '_serialize' key in your controller, you can specify a view variable |
| 14 | + * By setting the 'serialize' view builder option, you can specify a view variable |
15 | 15 | * that should be serialized to CSV and used as the response for the request. |
16 | | - * This allows you to omit views + layouts, if your just need to emit a single view |
| 16 | + * This allows you to omit templates + layouts, if your just need to emit a single view |
17 | 17 | * variable as the CSV response. |
18 | 18 | * |
19 | 19 | * In your controller, you could do the following: |
|
44 | 44 | * $this->viewBuilder()->setOption('serialize', ['posts', 'users']); |
45 | 45 | * ``` |
46 | 46 | * |
47 | | - * Each of the viewVars in `serialize` would then be output into the csv |
| 47 | + * Each of the view vars in `serialize` would then be output into the CSV output. |
48 | 48 | * |
49 | 49 | * If you don't use the `serialize` option, you will need a view. You can use extended |
50 | 50 | * views to provide layout like functionality. |
51 | 51 | * |
52 | 52 | * When not using custom views, you may specify the following view options: |
53 | 53 | * |
54 | | - * - array `$header`: (default null) A flat array of header column names |
55 | | - * - array `$footer`: (default null) A flat array of footer column names |
56 | | - * - string `$delimiter`: (default ',') CSV Delimiter, defaults to comma |
57 | | - * - string `$enclosure`: (default '"') CSV Enclosure for use with fputcsv() |
58 | | - * - string `$eol`: (default '\n') End-of-line character the csv |
| 54 | + * - array `header`: (default null) A flat array of header column names |
| 55 | + * - array `footer`: (default null) A flat array of footer column names |
| 56 | + * - string `delimiter`: (default ',') CSV Delimiter, defaults to comma |
| 57 | + * - string `enclosure`: (default '"') CSV Enclosure for use with fputcsv() |
| 58 | + * - string `eol`: (default '\n') End-of-line character the csv |
59 | 59 | * |
60 | 60 | * @link https://github.com/friendsofcake/cakephp-csvview |
61 | 61 | */ |
@@ -143,7 +143,7 @@ class CsvView extends SerializedView |
143 | 143 | * - 'dataEncoding': (default 'UTF-8') Encoding of data to be serialized |
144 | 144 | * - 'transcodingExtension': (default 'iconv') PHP extension to use for character encoding conversion |
145 | 145 | * |
146 | | - * @var array |
| 146 | + * @var array<string, mixed> |
147 | 147 | */ |
148 | 148 | protected $_defaultConfig = [ |
149 | 149 | 'extract' => null, |
|
0 commit comments