Package Data | |
---|---|
Maintainer Username: | mcstutterfish |
Maintainer Contact: | cblack@devonium.com (Christopher M. Black) |
Package Create Date: | 2016-03-22 |
Package Last Update: | 2016-07-27 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-15 15:17:41 |
Package Statistics | |
---|---|
Total Downloads: | 209 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 2 |
Total Watchers: | 1 |
Total Forks: | 1 |
Total Open Issues: | 0 |
Facebook Instant Articles RSS builder for Laravel 4
Add mcstutterfish/fbia-rss
to composer.json
.
"mcstutterfish/fbia-rss": "~1.0"
Run composer update
to pull down the latest version of FBIARss.
Now open up app/config/app.php
and add the service provider to your providers
array.
'providers' => array(
'FBIARss\FBIARssServiceProvider',
)
Now add the alias.
'aliases' => array(
'FBIARss' => 'FBIARss\FBIARssFacade',
)
Returns the feed
Route::get('/', function()
{
$feed = FBIARss::feed('2.0', 'UTF-8');
$feed->channel(array('title' => 'Channel\'s title', 'description' => 'Channel\'s description', 'link' => 'http://www.test.com/'));
for ($i=1; $i<=5; $i++){
$feed->item(array('title' => 'Item '.$i, 'description|cdata' => 'Description '.$i, 'link' => 'http://www.test.com/article-'.$i));
}
return Response::make($feed, 200, array('Content-Type' => 'text/xml'));
});
Save the feed
Route::get('/', function()
{
$feed = FBIARss::feed('2.0', 'UTF-8');
$feed->channel(array('title' => 'Channel\'s title', 'description' => 'Channel\'s description', 'link' => 'http://www.test.com/'));
for ($i=1; $i<=5; $i++){
$feed->item(array('title' => 'Item '.$i, 'description|cdata' => 'Description '.$i, 'link' => 'http://www.test.com/article-'.$i));
}
$feed->save('test.xml');
});