mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-31 13:50:23 +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:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
class HtmlFormat extends FormatAbstract {
|
||||
const MIME_TYPE = 'text/html';
|
||||
|
||||
public function stringify(){
|
||||
$extraInfos = $this->getExtraInfos();
|
||||
$title = htmlspecialchars($extraInfos['name']);
|
||||
@@ -120,7 +122,7 @@ EOD;
|
||||
|
||||
public function display() {
|
||||
$this
|
||||
->setContentType('text/html; charset=' . $this->getCharset())
|
||||
->setContentType(self::MIME_TYPE . '; charset=' . $this->getCharset())
|
||||
->callContentType();
|
||||
|
||||
return parent::display();
|
||||
|
Reference in New Issue
Block a user