Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response::$defaultFormatters #13541

Conversation

brandonkelly
Copy link
Member

Description

Adds the ability to modify the default response formatter configurations via config/app.web.php. For example, CsvResponseFormatter::$delimiter could be changed to chr(9) (a tab character) like so:

use craft\helpers\App;
use craft\helpers\ArrayHelper;
use craft\web\Response;

return [
    'components' => [
        'response' => fn() => Craft::createObject(ArrayHelper::merge(
            App::webResponseConfig(),
            [
                'defaultFormatters' => [
                    Response::FORMAT_CSV => [
                        'delimiter' => chr(9),
                    ],
                ],
            ]
        )),
    ],
];

@linear
Copy link

linear bot commented Aug 10, 2023

[ci skip]
@brandonkelly brandonkelly merged commit 63add36 into 4.5 Aug 10, 2023
@brandonkelly brandonkelly deleted the feature/dev-1152-ability-to-customize-the-default-csv-formatting-options branch August 10, 2023 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant