如何在刀片视图中呈现xml数据

时间:2016-10-15 19:16:32

标签: laravel rss-reader

我有一个严格的root响应xml daha,如下图所示:

Route::get('feed', function() {
    $feed = App::make("feed");
    $feed->setCache(60, 'feedNewsKey');
    if (!$feed->isCached()) {
        $news = \DB::table('news')->orderBy('created_at', 'desc')->take(20)->get();
        foreach ($news as $post) {
            $feed->add($post->title, 'asd', url('detail/' . $post->id), $post->created_at, $post->description, $post->description,['user_id'=>$post->id, 'photo'=>$post->photo]);
        }
    }
    return $feed->render('atom');
});

enter image description here

我想知道如何在blade.php视图文件中迭代这些xlm数据?

0 个答案:

没有答案