.htaccess + more pages & routes
This commit is contained in:
@@ -24,14 +24,15 @@ abstract class Document {
|
||||
public function getBody() { return $this->body; }
|
||||
public function getSQL() { return $this->user->getSQL(); }
|
||||
public function getUser() { return $this->user; }
|
||||
public function getView() { return $this->activeView; }
|
||||
|
||||
protected function sendHeaders() {
|
||||
header("X-Frame-Options: DENY");
|
||||
}
|
||||
public function getView() : ?View {
|
||||
|
||||
public static function createSearchableDocument($documentClass, $user) {
|
||||
return new $documentClass($user);
|
||||
$file = getClassPath($this->activeView);
|
||||
if(!file_exists($file) || !is_subclass_of($this->activeView, View::class)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new $this->activeView($this);
|
||||
}
|
||||
|
||||
function getCode() {
|
||||
@@ -47,9 +48,10 @@ abstract class Document {
|
||||
|
||||
$body = $this->body->getCode();
|
||||
$head = $this->head->getCode();
|
||||
$lang = $this->user->getLanguage()->getShortCode();
|
||||
|
||||
$html = "<!DOCTYPE html>";
|
||||
$html .= "<html>";
|
||||
$html .= "<html lang=\"$lang\">";
|
||||
$html .= $head;
|
||||
$html .= $body;
|
||||
$html .= "</html>";
|
||||
|
||||
16
core/Elements/SimpleBody.class.php
Normal file
16
core/Elements/SimpleBody.class.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Elements;
|
||||
|
||||
abstract class SimpleBody extends Body {
|
||||
public function __construct($document) {
|
||||
parent::__construct($document);
|
||||
}
|
||||
|
||||
public function getCode() {
|
||||
$content = $this->getContent();
|
||||
return parent::getCode() . "<body>$content</body>";
|
||||
}
|
||||
|
||||
protected abstract function getContent();
|
||||
}
|
||||
@@ -83,7 +83,7 @@ abstract class View extends StaticView {
|
||||
if($classes)
|
||||
$iconClass .= " $classes";
|
||||
|
||||
return "<i class=\"$iconClass\"></i>";
|
||||
return "<i class=\"$iconClass\" />";
|
||||
}
|
||||
|
||||
protected function createErrorText($text, $id="", $hidden=false) {
|
||||
|
||||
Reference in New Issue
Block a user