portal.mkgtu.ru/common/components/maintenance/controllers/MaintenanceController.php

31 lines
655 B
PHP
Raw Normal View History

2024-03-28 09:51:45 +03:00
<?php
namespace common\components\maintenance\controllers;
use Yii;
use yii\web\Controller;
class MaintenanceController extends Controller
{
public $retryAfter;
public $maintenanceLayout;
public $maintenanceView;
public $maintenanceText;
public function actionIndex()
{
$this->layout = $this->maintenanceLayout;
Yii::$app->response->statusCode = 503;
Yii::$app->response->headers->set('Retry-After', $this->retryAfter);
return $this->render($this->maintenanceView, [
'maintenanceText' => $this->maintenanceText,
'retryAfter' => $this->retryAfter
]);
}
}