mayconbordin/rss-l5
最新稳定版本:1.1
Composer 安装命令:
composer require mayconbordin/rss-l5
包简介
RSS builder for Laravel 5
关键字:
README 文档
README
RSS builder for Laravel 5
Installation
Add mayconbordin/rss-l5 to composer.json.
"mayconbordin/rss-l5": "~1.1"
Run composer update to pull down the latest version of RSS.
Now open up app/config/app.php and add the service provider to your providers array.
'providers' => array( 'Thujohn\Rss\RssServiceProvider', )
Now add the alias.
'aliases' => array( 'Rss' => 'Thujohn\Rss\RssFacade', )
Usage
Returns the feed
Route::get('/', function() { $feed = Rss::feed('2.0', 'UTF-8'); $feed->channel([ 'title' => "Channel's title", 'description' => "Channel's description", 'link' => "http://www.test.com/" ]); for ($i=1; $i<=5; $i++) { $feed->item([ 'title' => 'Item '.$i, 'description|cdata' => 'Description '.$i, 'link' => 'http://www.test.com/article-'.$i ]); } return response($feed, 200)->header('Content-Type', 'text/xml'); });
Save the feed
Route::get('/', function() { $feed = Rss::feed('2.0', 'UTF-8'); $feed->channel([ 'title' => "Channel's title", 'description' => "Channel's description", 'link' => "http://www.test.com/" ]); for ($i=1; $i<=5; $i++) { $feed->item([ 'title' => 'Item '.$i, 'description|cdata' => 'Description '.$i, 'link' => 'http://www.test.com/article-'.$i ]); } $feed->save('test.xml'); });
统计信息
- 总下载量: 7.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-08