mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 11:05:48 +02:00
Add extension hook points.
This commit is contained in:
parent
1c5e737d06
commit
d42fba7906
@ -34,8 +34,11 @@ class GoogleSitemapController extends Controller {
|
||||
|
||||
$this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"');
|
||||
|
||||
$sitemaps = GoogleSitemap::get_sitemaps();
|
||||
$this->extend('updateGoogleSitemaps', $sitemaps);
|
||||
|
||||
return array(
|
||||
'Sitemaps' => GoogleSitemap::get_sitemaps()
|
||||
'Sitemaps' => $sitemaps
|
||||
);
|
||||
} else {
|
||||
return new SS_HTTPResponse('Page not found', 404);
|
||||
@ -57,9 +60,11 @@ class GoogleSitemapController extends Controller {
|
||||
|
||||
$this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"');
|
||||
|
||||
// But we want to still render.
|
||||
$items = GoogleSitemap::get_items($class, $page);
|
||||
$this->extend('updateGoogleSitemapItems', $items, $class, $page);
|
||||
|
||||
return array(
|
||||
'Items' => GoogleSitemap::get_items($class, $page)
|
||||
'Items' => $items
|
||||
);
|
||||
} else {
|
||||
return new SS_HTTPResponse('Page not found', 404);
|
||||
|
Loading…
Reference in New Issue
Block a user