Beispiel #1
0
<?php

use Cms\Classes\Theme;
use RainLab\Sitemap\Models\Definition;
Route::get('sitemap.xml', function () {
    $themeActive = Theme::getActiveTheme()->getDirName();
    return Response::make(Definition::where('theme', $themeActive)->firstOrFail()->generateSitemap())->header("Content-Type", "application/xml");
});
Beispiel #2
0
 protected function redirectToThemeSitemap($theme)
 {
     $model = Definition::firstOrCreate(['theme' => $theme->getDirName()]);
     $updateUrl = sprintf('rainlab/sitemap/definitions/update/%s', $model->getKey());
     return Backend::redirect($updateUrl);
 }
Beispiel #3
0
<?php

use RainLab\Sitemap\Models\Definition;
Route::get('sitemap.xml', function () {
    header("Content-Type: application/xml");
    return Definition::first()->generateSitemap();
});