mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-06 08:37:30 +02:00
formats: Add getMimeType() function (#1299)
Allows getting the expected MIME type of the format's output. A corresponding MIME_TYPE constant is also defined in FormatAbstract for the format implementations to overwrite.
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
* Returns $this->items as raw php data.
|
||||
*/
|
||||
class PlaintextFormat extends FormatAbstract {
|
||||
const MIME_TYPE = 'text/plain';
|
||||
|
||||
public function stringify(){
|
||||
$items = $this->getItems();
|
||||
$data = array();
|
||||
@@ -22,7 +24,7 @@ class PlaintextFormat extends FormatAbstract {
|
||||
|
||||
public function display(){
|
||||
$this
|
||||
->setContentType('text/plain; charset=' . $this->getCharset())
|
||||
->setContentType(self::MIME_TYPE . '; charset=' . $this->getCharset())
|
||||
->callContentType();
|
||||
|
||||
return parent::display();
|
||||
|
Reference in New Issue
Block a user