rss.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use \app\models\base\Comments;
  3. use yii\helpers\Html;
  4. use yii\helpers\Url;
  5. use yii\widgets\ListView;
  6. /** @var yii\web\View $this */
  7. /** @var yii\data\ActiveDataProvider $dataProvider */
  8. Yii::$app->response->format = \yii\web\Response::FORMAT_RAW;
  9. Yii::$app->response->headers->set('content-type', 'application/xml;charset=utf-8');
  10. ?>
  11. <<?='?'?>xml version="1.0" encoding="UTF-8"<?='?'?>>
  12. <rss version="2.0"
  13. xml:base="https://www.amic.ru/"
  14. xmlns:content="http://purl.org/rss/1.0/modules/content/"
  15. xmlns:dc="http://purl.org/dc/elements/1.1/"
  16. >
  17. <channel>
  18. <title><![CDATA[ИА "Амител" "Последнии коментарии"]]></title>
  19. <link>https://www.amic.ru/</link>
  20. <language>ru</language>
  21. <?
  22. echo ListView::widget([
  23. "dataProvider" =>$dataProvider,
  24. "itemView" => "_item",
  25. "layout" => "{items}",
  26. "options" => ['tag' => false],
  27. "itemOptions" => ['tag' => false]
  28. ]);
  29. ?>
  30. </channel>
  31. </rss>