replaced confusing loadView behaviour

This commit is contained in:
2026-05-22 13:47:13 +02:00
parent cc81a9764f
commit 3342d10737
5 changed files with 12 additions and 11 deletions

View File

@@ -7,15 +7,15 @@ use Core\Objects\Context;
abstract class View extends StaticView {
private Document $document;
private bool $loadView;
private bool $autoload;
protected string $title;
protected array $langModules;
public function __construct(Document $document, bool $loadView = true) {
public function __construct(Document $document, bool $autoload = true) {
$this->document = $document;
$this->title = "Untitled View";
$this->langModules = [];
$this->loadView = $loadView;
$this->autoload = $autoload;
}
public function getTitle(): string { return $this->title; }
@@ -52,7 +52,7 @@ abstract class View extends StaticView {
public function getCode(): string {
// Load metadata + head (title, scripts, includes, ...)
if ($this->loadView) {
if ($this->autoload) {
$this->loadView();
}