PHP Universal Feed Generator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
340 B

<?php
namespace FeedWriter\View;
class JSON {
public $require = ['date', 'author'];
protected $_struct = [];
public function collect ($item)
{
$this->_struct[] = [
'date' => $item->date,
'author' => $item->author
];
}
public function generateFeed ()
{
return json_encode($this->_struct);
}
}