10 if(!headers_sent()) header(
'Content-type: application/rss+xml; charset=utf-8');
11 $rss = new \SimpleXmlElement(
'<rss version="2.0" />');
12 $this->
xmlEncode($channel = $rss->addChild(
'channel'),$this->channel);
13 foreach($this->items as $item) $this->
xmlEncode($channel->addChild(
'item'),$item);
19 'title' => $this->title,
20 'link' => \Rsi\Http::host(
true) . $this->_controller->route(),
21 'copyright' => \Rsi\Http::host(),
22 'pubDate' => date(
'r'),
23 'generator' =>
'FRED™ RSS view' 28 $html = $this->_fred->html;
31 $title = $date = null;
33 foreach($widget->columns as $column => $config){
34 $captions[$column] = $widget->columnCaption($column);
35 if(!$title && !($config[
'format'] ?? null)) $title = $column;
36 if(!$date && (substr($config[
'format'] ?? null,0,4) ==
'date')) $date = $column;
38 $widget->searchParams($search,$order);
39 foreach($widget->provider->search($search,$order,$widget->params,0,$this->limit) as $record){
41 foreach($captions as $column => $caption) $table .= $html->tr($html->_th($caption) . $html->_td($record[$column]));
42 $item = [
'guid' => md5(implode(
'|',$record)),
'description' => $html->table($table)];
43 if($title) $item[
'title'] = $record[$title];
44 if($date) $item[
'pubDate'] = date(
'r',strtotime($record[$date]));
Framework for Rapid and Easy Development.
xmlEncode($parent, $data)