Obvody/app/Presentation/BasePresenter.php

26 lines
562 B
PHP

<?php
declare(strict_types=1);
namespace App\Presentation;
use Nette;
use App\Core\Konstanty;
abstract class BasePresenter extends Nette\Application\UI\Presenter
{
protected function startup(): void
{
parent::startup();
if (!$this->getUser()->isLoggedIn()) {
$this->flashMessage('Pro tuto agendu se přihlaste.');
$this->redirect(':Sign:in', ['backlink' => $this->storeRequest()]);
}
}
public function beforeRender(): void
{
$this->template->appVersion = Konstanty::verze;
}
}