mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-31 13:50:23 +02:00
Refonte du code
This commit is contained in:
24
formats/JsonFormat.php
Normal file
24
formats/JsonFormat.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Json
|
||||
* Builds a JSON string from $this->items and return it to browser.
|
||||
*
|
||||
* @name Json
|
||||
*/
|
||||
class JsonFormat extends FormatAbstract{
|
||||
|
||||
public function stringify(){
|
||||
// FIXME : sometime content can be null, transform to empty string
|
||||
$datas = $this->getDatas();
|
||||
|
||||
return json_encode($datas);
|
||||
}
|
||||
|
||||
public function display(){
|
||||
$this
|
||||
->setContentType('application/json')
|
||||
->callContentType();
|
||||
|
||||
return parent::display();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user