mirror of
https://github.com/kevachat/webapp.git
synced 2025-01-22 12:34:25 +00:00
draft rss
This commit is contained in:
parent
88986b3ad1
commit
8094de23a4
@ -165,7 +165,20 @@ class RoomController extends AbstractController
|
||||
$feed
|
||||
);
|
||||
|
||||
// Return result
|
||||
// RSS
|
||||
if ('RSS' === $request->get('feed'))
|
||||
{
|
||||
return $this->render(
|
||||
'default/room/index.rss.twig',
|
||||
[
|
||||
'name' => $name,
|
||||
'feed' => $feed,
|
||||
'request' => $request
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
// HTML
|
||||
return $this->render(
|
||||
'default/room/index.html.twig',
|
||||
[
|
||||
|
17
templates/default/room/index.rss.twig
Normal file
17
templates/default/room/index.rss.twig
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<channel>
|
||||
<atom:link href="{{ url('room_namespace', { namespace : request.get('namespace') }) }}" rel="self" type="application/rss+xml"></atom:link>
|
||||
<title>{{ name }} - {{ app.name }}</title>
|
||||
<link>{{ url('room_namespace', { namespace : request.get('namespace') }) }}</link>
|
||||
{% for post in feed %}
|
||||
<item>
|
||||
<title>{{ post.user }}</title>
|
||||
<author>#{{ post.user }}</author>
|
||||
<pubDate>{{ post.timestamp | date('D, d M Y h:i:s O') }}</pubDate>
|
||||
<guid>{{ url('room_namespace', { namespace : request.get('namespace') }) }}#{{ post.id }}</guid>
|
||||
<link>{{ url('room_namespace', { namespace : request.get('namespace') }) }}#{{ post.id }}</link>
|
||||
</item>
|
||||
{% endfor %}
|
||||
</channel>
|
||||
</rss>
|
Loading…
x
Reference in New Issue
Block a user