Routing, static views
This commit is contained in:
@@ -29,12 +29,7 @@ namespace Documents\Admin {
|
||||
}
|
||||
|
||||
protected function initSources() {
|
||||
// $this->loadJQuery();
|
||||
$this->loadFontawesome();
|
||||
// $this->addJS(Script::CORE);
|
||||
// $this->addCSS(Link::CORE);
|
||||
// $this->addJS(Script::ADMIN);
|
||||
// $this->addCSS(Link::ADMIN);
|
||||
}
|
||||
|
||||
protected function initMetas() {
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace Documents\Document404 {
|
||||
|
||||
use Elements\Body;
|
||||
use Elements\Head;
|
||||
use Elements\SimpleBody;
|
||||
use Views\View404;
|
||||
|
||||
class Head404 extends Head {
|
||||
@@ -47,7 +48,7 @@ namespace Documents\Document404 {
|
||||
}
|
||||
}
|
||||
|
||||
class Body404 extends Body {
|
||||
class Body404 extends SimpleBody {
|
||||
|
||||
public function __construct($document) {
|
||||
parent::__construct($document);
|
||||
@@ -57,10 +58,8 @@ namespace Documents\Document404 {
|
||||
http_response_code(404);
|
||||
}
|
||||
|
||||
public function getCode() {
|
||||
$html = parent::getCode();
|
||||
$html .= "<body>" . (new View404($this->getDocument())) . "</body>";
|
||||
return $html;
|
||||
protected function getContent() {
|
||||
return $this->load(View404::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Documents {
|
||||
|
||||
use Documents\Welcome\WelcomeBody;
|
||||
use Documents\Welcome\WelcomeHead;
|
||||
use Elements\Document;
|
||||
use Objects\User;
|
||||
|
||||
class Welcome extends Document {
|
||||
public function __construct(User $user, ?string $view) {
|
||||
parent::__construct($user, WelcomeHead::class, WelcomeBody::class, $view);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Documents\Welcome {
|
||||
|
||||
use Elements\Head;
|
||||
use Elements\SimpleBody;
|
||||
|
||||
class WelcomeHead extends Head {
|
||||
|
||||
public function __construct($document) {
|
||||
parent::__construct($document);
|
||||
}
|
||||
|
||||
protected function initSources() {
|
||||
$this->loadBootstrap();
|
||||
}
|
||||
|
||||
protected function initMetas() {
|
||||
return array(
|
||||
array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0'),
|
||||
array('name' => 'format-detection', 'content' => 'telephone=yes'),
|
||||
array('charset' => 'utf-8'),
|
||||
array("http-equiv" => 'expires', 'content' => '0'),
|
||||
array("name" => 'robots', 'content' => 'noarchive'),
|
||||
);
|
||||
}
|
||||
|
||||
protected function initRawFields() {
|
||||
return array();
|
||||
}
|
||||
|
||||
protected function initTitle() {
|
||||
return "Welcome";
|
||||
}
|
||||
}
|
||||
|
||||
class WelcomeBody extends SimpleBody {
|
||||
|
||||
public function __construct($document) {
|
||||
parent::__construct($document);
|
||||
}
|
||||
|
||||
protected function getContent() {
|
||||
return
|
||||
"<div class='container mt-5'>
|
||||
<div class='row'>
|
||||
<div class='col-lg-9 col-12 mx-auto'>
|
||||
<div class='jumbotron'>
|
||||
<h1>Congratulations!</h1>
|
||||
<p class='lead'>Your Web-Base Installation is now ready to use!</p>
|
||||
<hr class='my-4' />
|
||||
<p>
|
||||
You can now login into your <a href='/admin'>Administrator Dashboard</a> to adjust your settings
|
||||
and add routes & pages.
|
||||
You can add new documents and views by adding classes in the corresponding
|
||||
directories and link to them, by creating rules in the Administrator Dashboard.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user