silverstripe-webpack/app/src/Pages/PageController.php

36 lines
820 B
PHP
Raw Normal View History

2018-04-21 06:29:32 +02:00
<?php
// vendor/silverstripe/errorpage/src/ErrorPageController.php
// extends global PageController class
//namespace Site\Pages;
use SilverStripe\CMS\Controllers\ContentController;
use SilverStripe\ORM\FieldType\DBDatetime;
2018-04-21 06:29:32 +02:00
class PageController extends ContentController
{
2018-09-15 00:55:42 +02:00
public function setSiteWideMessage($message, $type)
2018-08-06 13:46:54 +02:00
{
2018-09-15 00:55:42 +02:00
$this->getRequest()->getSession()->set(
'SiteWideMessage',
[
'Message' => $message,
'Type' => $type,
]
);
2018-08-06 13:46:54 +02:00
}
2018-09-15 00:55:42 +02:00
public function getSiteWideMessage()
2018-08-06 13:46:54 +02:00
{
2018-09-15 00:55:42 +02:00
$session = $this->getRequest()->getSession();
$session->clear('SiteWideMessage');
return $session->get('SiteWideMessage');
2018-08-06 13:46:54 +02:00
}
public function CurrentTime()
{
return DBDatetime::now();
}
2018-04-21 06:29:32 +02:00
}