2627 - Арт Проект. Подключение турбо страниц для сайта task-on.com

parent f8597da4
...@@ -60,11 +60,13 @@ class Rss extends BaseObject ...@@ -60,11 +60,13 @@ class Rss extends BaseObject
]) ])
->all(); ->all();
foreach ($models as $model) { foreach ($models as $model) {
$text = preg_replace('/ (class|id|style)=".*?"/', '', $model->text);
$text = preg_replace('/(<img[^>]+>)/', '<figure>$1</figure>', $text);
$item = new Item(); $item = new Item();
$item $item
->title($model->title) ->title($model->title)
->link(Url::to(["/{$model->post->url}"], true)) ->link(Url::to(["/{$model->post->url}"], true))
->turboContent(preg_replace('/ (class|id|style)=".*?"/', '', $model->text)) ->turboContent($text)
->pubDate($model->created_at) ->pubDate($model->created_at)
->appendTo($channel); ->appendTo($channel);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment