1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-06-12 09:31:36 +02:00

Formats: Remove display & related method (#2776)

Format should not be responsible for sending HTTP response.
This commit is contained in:
Jan Tojnar
2022-06-07 18:05:33 +02:00
committed by GitHub
parent e85932b1a5
commit fb501652d5
13 changed files with 11 additions and 178 deletions

View File

@ -14,14 +14,6 @@ Find a [template](#template) at the end of this file
# Functions
## The `display` function
The `display` function shows the contents to the user and must return the object instance.
```PHP
display(): self
```
## The `stringify` function
The `stringify` function returns the items received by [`setItems`](#the-setitem-function) as string.
@ -109,12 +101,6 @@ class MyTypeFormat implements FormatInterface {
return ''; // Return items as string
}
public function display(){
// Implement your code here
echo $this->stringify();
return $this;
}
public function setItems(array $items){
$this->items = $items;
return $this;

View File

@ -1,27 +1,9 @@
The `FormatAbstract` class implements the [`FormatInterface`](../08_Format_API/02_FormatInterface.md) interface with basic functional behavior and adds common helper functions for new formats:
* [setContentType](#the-setcontenttype-function)
* [callContentType](#the-callcontenttype-function)
* [sanitizeHtml](#the-sanitizehtml-function)
# Functions
## The `setContentType` function
The `setContentType` function receives a string defining the content type for the HTML header and must return the object instance.
```PHP
setContentType(string): self
```
## The `callContentType` function
The `callContentType` function applies the content type to the header data and must return the object instance.
```PHP
callContentType(): self
```
## The `sanitizeHtml` function
The `sanitizeHtml` function receives an HTML formatted string and returns the string with disabled `<script>`, `<iframe>` and `<link>` tags.