質問編集履歴
2
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -59,6 +59,12 @@
|
|
59
59
|
###エラーメッセージ
|
60
60
|
```エラー
|
61
61
|
Warning (2): stream_filter_append(): user-filter "eolFilter" requires class "eol_filter", but that class is not defined [APP/Controller/DbackordersController.php, line 333]
|
62
|
+
Warning (2): stream_filter_append() [<a href='http://php.net/function.stream-filter-append'>function.stream-filter-append</a>]: unable to create or locate filter "eolFilter" [APP/Controller/DbackordersController.php, line 333]
|
63
|
+
Warning (2): stream_filter_append() [<a href='http://php.net/function.stream-filter-append'>function.stream-filter-append</a>]: user-filter "encodeFilter" requires class "encode_filter", but that class is not defined [APP/Controller/DbackordersController.php, line 334]
|
64
|
+
Warning (2): stream_filter_append() [<a href='http://php.net/function.stream-filter-append'>function.stream-filter-append</a>]: unable to create or locate filter "encodeFilter" [APP/Controller/DbackordersController.php, line 334]
|
65
|
+
Warning (2): Cannot modify header information - headers already sent by (output started at /Users/shintarokaminaga/Sites/azmap/vendor/cakephp/cakephp/src/Error/Debugger.php:754) [APP/Controller/DbackordersController.php, line 337]
|
66
|
+
Warning (2): Cannot modify header information - headers already sent by (output started at /Users/shintarokaminaga/Sites/azmap/vendor/cakephp/cakephp/src/Error/Debugger.php:754) [APP/Controller/DbackordersController.php, line 338]
|
67
|
+
Warning (2): fputcsv() expects parameter 2 to be array, object given [APP/Controller/DbackordersController.php, line 343]
|
62
68
|
```
|
63
69
|
|
64
70
|
###実現したいこと
|
1
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -30,16 +30,16 @@
|
|
30
30
|
public function export(){
|
31
31
|
$this->autoRender = false;
|
32
32
|
$results = $this->Dbackorders->find()->toArray();
|
33
|
-
|
33
|
+
|
34
|
-
|
34
|
+
// フィルタを登録
|
35
35
|
stream_filter_register("eolFilter", "eol_filter");
|
36
36
|
stream_filter_register("encodeFilter", "encode_filter");
|
37
37
|
|
38
38
|
$fp = fopen('php://output', 'w');
|
39
39
|
|
40
40
|
// フィルタを開いたストリームに付加する
|
41
|
+
stream_filter_append($fp, "eolFilter");
|
41
|
-
|
42
|
+
stream_filter_append($fp, "encodeFilter");
|
42
|
-
stream_filter_append($fp, "convert.iconv.UTF-8/CP932", STREAM_FILTER_WRITE);
|
43
43
|
|
44
44
|
// ダウンロードさせる
|
45
45
|
header('Content-Type: text/csv');
|