Update 02_RSSFeed.md

Change file name to PageController to match code.
Change example code to use parameter in `Link()` method rather than using concatenation
This commit is contained in:
DorsetDigital 2019-03-23 13:22:37 +00:00 committed by GitHub
parent 5243ec2179
commit abe76e9b29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ RSSFeed::linkToFeed($link, $title);
You can use [RSSFeed](api:SilverStripe\Control\RSS\RSSFeed) to easily create a feed showing your latest Page updates. The following example adds a page You can use [RSSFeed](api:SilverStripe\Control\RSS\RSSFeed) to easily create a feed showing your latest Page updates. The following example adds a page
`/home/rss/` which displays an XML file the latest updated pages. `/home/rss/` which displays an XML file the latest updated pages.
**app/code/Page.php** **app/code/PageController.php**
```php ```php
use SilverStripe\Control\RSS\RSSFeed; use SilverStripe\Control\RSS\RSSFeed;
@ -71,7 +71,7 @@ class PageController extends ContentController
{ {
parent::init(); parent::init();
RSSFeed::linkToFeed($this->Link() . "rss", "10 Most Recently Updated Pages"); RSSFeed::linkToFeed($this->Link("rss"), "10 Most Recently Updated Pages");
} }
public function rss() public function rss()