Yassine Doghri c815ecd664 feat(rss): generate rss feed from podcast entity
- refactor episode, podcast and category entities to add dynamic properties
- refactor Routes when adding feed route
- update migration files to better fit itunes' and rss' specs
- update podcast and episode forms
- add SimpleRSSElement class to Libraries
- add rss_helper
- update home controller to redirect if system has only one podcast
2020-10-15 14:40:55 +00:00

23 lines
514 B
PHP

<?php
namespace App\Controllers;
use App\Models\PodcastModel;
use CodeIgniter\Controller;
class Feed extends Controller
{
public function index($podcast_name)
{
helper('rss');
$podcast_model = new PodcastModel();
$podcast = $podcast_model->where('name', $podcast_name)->first();
// The page cache is set to a decade so it is deleted manually upon podcast update
$this->cachePage(DECADE);
return $this->response->setXML(get_rss_feed($podcast));
}
}