Namespace and ClassPath rewrites
This commit is contained in:
39
Core/Elements/TemplateView.class.php
Normal file
39
Core/Elements/TemplateView.class.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Core\Elements;
|
||||
|
||||
abstract class TemplateView extends View {
|
||||
|
||||
protected array $keywords = [];
|
||||
protected string $description = "";
|
||||
|
||||
public function __construct(TemplateDocument $document) {
|
||||
parent::__construct($document);
|
||||
$this->title = "";
|
||||
}
|
||||
|
||||
protected function getParameters(): array {
|
||||
return [];
|
||||
}
|
||||
|
||||
public function loadParameters(array &$parameters) {
|
||||
|
||||
$siteParameters = [
|
||||
"title" => $this->title,
|
||||
"description" => $this->description,
|
||||
"keywords" => $this->keywords
|
||||
];
|
||||
|
||||
foreach ($siteParameters as $key => $value) {
|
||||
if ($value) {
|
||||
$parameters["site"][$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$parameters["view"] = $this->getParameters();
|
||||
}
|
||||
|
||||
public function getCode(): string {
|
||||
return $this->getDocument()->getCode();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user