File tree 3 files changed +20
-7
lines changed
3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 48
48
"source-directory" : " config"
49
49
},
50
50
"config-plugin" : {
51
+ "params" : " params.php" ,
51
52
"web" : " web.php"
52
53
}
53
54
},
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ use Yiisoft \DataResponse \Formatter \HtmlDataResponseFormatter ;
6
+ use Yiisoft \DataResponse \Formatter \XmlDataResponseFormatter ;
7
+ use Yiisoft \DataResponse \Formatter \JsonDataResponseFormatter ;
8
+
9
+ return [
10
+ 'yiisoft/data-response ' => [
11
+ 'contentFormatters ' => [
12
+ 'text/html ' => HtmlDataResponseFormatter::class,
13
+ 'application/xml ' => XmlDataResponseFormatter::class,
14
+ 'application/json ' => JsonDataResponseFormatter::class,
15
+ ],
16
+ ],
17
+ ];
Original file line number Diff line number Diff line change 6
6
use Yiisoft \DataResponse \DataResponseFactoryInterface ;
7
7
use Yiisoft \DataResponse \DataResponseFormatterInterface ;
8
8
use Yiisoft \DataResponse \Formatter \HtmlDataResponseFormatter ;
9
- use Yiisoft \DataResponse \Formatter \XmlDataResponseFormatter ;
10
- use Yiisoft \DataResponse \Formatter \JsonDataResponseFormatter ;
11
9
use Yiisoft \DataResponse \Middleware \ContentNegotiator ;
10
+ use Yiisoft \Di \DynamicReferencesArray ;
12
11
13
12
/* @var $params array */
14
13
17
16
DataResponseFactoryInterface::class => DataResponseFactory::class,
18
17
ContentNegotiator::class => [
19
18
'__construct() ' => [
20
- 'contentFormatters ' => [
21
- 'text/html ' => new HtmlDataResponseFormatter (),
22
- 'application/xml ' => new XmlDataResponseFormatter (),
23
- 'application/json ' => new JsonDataResponseFormatter (),
24
- ],
19
+ 'contentFormatters ' => DynamicReferencesArray::from ($ params ['yiisoft/data-response ' ]['contentFormatters ' ]),
25
20
],
26
21
],
27
22
];
You can’t perform that action at this time.
0 commit comments