. */ namespace SP\Modules\Web\Controllers; use Klein\Klein; use SP\Bootstrap; use SP\Core\Traits\InjectableTrait; use SP\Mvc\View\Template; use SP\Util\Util; /** * Class ErrorController * * @package SP\Modules\Web\Controllers */ class ErrorController { use InjectableTrait; /** * @var Template */ protected $view; /** * @var Klein */ protected $router; /** * ErrorController constructor. * * @throws \ReflectionException * @throws \SP\Core\Dic\ContainerException */ public function __construct() { $this->injectDependencies(); } /** * @param Template $view * @param Klein $router */ public function inject(Template $view, Klein $router) { $this->view = $view; $this->router = $router; } /** * @todo */ public function indexAction() { $this->view->assign('startTime', microtime()); $this->view->assign('appInfo', Util::getAppInfo()); $this->view->assign('appVersion', Util::getVersionString()); $this->view->assign('logoIcon', Bootstrap::$WEBURI . '/public/images/logo_icon.png'); $this->view->assign('logoNoText', Bootstrap::$WEBURI . '/public/images/logo_icon.svg'); $this->view->assign('logo', Bootstrap::$WEBURI . '/public/images/logo_full_bg.png'); $this->view->assign('logonobg', Bootstrap::$WEBURI . '/public/images/logo_full_nobg.png'); $this->view->assign('lang', 'en'); $this->view->assign('error', 'Error!'); $this->router->response()->header('Content-Type', 'text/html; charset=UTF-8'); $this->router->response()->header('Cache-Control', 'public, no-cache, max-age=0, must-revalidate'); $this->router->response()->header('Pragma', 'public; max-age=0'); } }