silverstripe-subsites/code/extensions/ControllerSubsites.php
2016-09-23 09:34:23 +01:00

23 lines
402 B
PHP

<?php
use SilverStripe\View\SSViewer;
use SilverStripe\Core\Extension;
/**
* @package subsites
*/
class ControllerSubsites extends Extension {
function controllerAugmentInit(){
if($subsite = Subsite::currentSubsite()){
if($theme = $subsite->Theme)
SSViewer::set_theme($theme);
}
}
function CurrentSubsite(){
if($subsite = Subsite::currentSubsite()){
return $subsite;
}
}
}
?>