Yii 2.0: text-responses

Text response formatter: format responses as plain text.
1 follower

Text Response Formatter for Yii

ReleaseLicenseDownloadsCode qualityBuild

Text response formatter for Yii, high-performance PHP framework.

This package provides a single class, yii\web\TextResponseFormatter which is a response formatter allowing to format a given data into a plain text response content and set the "Content-Type" header as text/plain.

Requirements

The latest PHP and Composer versions. If you plan to play with the sources, you will also need the Phing latest version.

Installing via Composer

From a command prompt, run:

$ composer require cedx/yii2-text-responses

Now in your application configuration file, you can use the following response formatter:

return [
  'components' => [
    'response' => [
      'formatters' => [
        'text' => 'yii\web\TextResponseFormatter'
      ]
    ]
  ]
];

See Also

License

Text Response Formatter for Yii is distributed under the Apache License, version 2.0.

Be the first person to leave a comment

Please to leave your comment.

Create extension