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.

24 lines
380 B

<?php
namespace FeedWriter\View;
use \SparkLib\CSV as SparkCSV;
class CSV {
public function __construct ()
{
$this->_csv = new SparkCSV();
$this->_csv->addHeader(['date', 'author']);
}
public function collect ($item)
{
$this->_csv->addRow([$item->date, $item->author]);
}
public function generateFeed ()
{
return $this->_csv->render();
}
}