mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-04 23:28:41 +02:00
commit
cc6bdfe459
@ -43,6 +43,7 @@ SilverStripe what values to include in the feed.
|
|||||||
|
|
||||||
:::php
|
:::php
|
||||||
class Page_Controller extends ContentController {
|
class Page_Controller extends ContentController {
|
||||||
|
private static $allowed_actions = array('rss');
|
||||||
public function init() {
|
public function init() {
|
||||||
// linkToFeed will add an appropriate HTML link tag to the website
|
// linkToFeed will add an appropriate HTML link tag to the website
|
||||||
// <head> tag to notify web browsers that an RSS feed is available
|
// <head> tag to notify web browsers that an RSS feed is available
|
||||||
@ -80,6 +81,8 @@ updates. Update mysite/code/Page.php to something like this:
|
|||||||
<?php
|
<?php
|
||||||
class Page extends SiteTree {}
|
class Page extends SiteTree {}
|
||||||
class Page_Controller extends ContentController {
|
class Page_Controller extends ContentController {
|
||||||
|
|
||||||
|
private static $allowed_actions = array('rss');
|
||||||
|
|
||||||
public function init() {
|
public function init() {
|
||||||
RSSFeed::linkToFeed($this->Link() . "rss", "10 Most Recently Updated Pages");
|
RSSFeed::linkToFeed($this->Link() . "rss", "10 Most Recently Updated Pages");
|
||||||
@ -123,6 +126,7 @@ for all the students as we've seen before.
|
|||||||
|
|
||||||
:::php
|
:::php
|
||||||
class Page_Controller extends ContentController {
|
class Page_Controller extends ContentController {
|
||||||
|
private static $allowed_actions = array('students');
|
||||||
public function init() {
|
public function init() {
|
||||||
RSSFeed::linkToFeed($this->Link("students"), "Students feed");
|
RSSFeed::linkToFeed($this->Link("students"), "Students feed");
|
||||||
parent::init();
|
parent::init();
|
||||||
@ -172,4 +176,4 @@ accessing feeds from external sources.
|
|||||||
|
|
||||||
## API Documentation
|
## API Documentation
|
||||||
|
|
||||||
* `[api:RSSFeed]`
|
* `[api:RSSFeed]`
|
||||||
|
Loading…
Reference in New Issue
Block a user