Commit aca8a8ca authored by Webserver User's avatar Webserver User

new release

parent 38cbcd5c
......@@ -23,22 +23,22 @@ class indexController {
*/
# create a new path, similar to the url
$url = 'blog';
#$url = 'index';
# !or directly several pages
# $url = 'blog/article/comment/';
# create an object of the type page
$newPage = (new simple\Page($url));
#$newPage = (new simple\Page($url));
# add the new page to you manifest
//$newPage->add();
#$newPage->add();
# !or use the short way
# $pages = new simple\Page($url)->add();
# you new pages now in your manifest, that you find in /simplemvc
# now load your manifest
$manifest = new simple\Manifest();
#$manifest = new simple\Manifest();
# !if you want take a look, you can use
#$this->view = $manifest->get();
......
......@@ -14,7 +14,7 @@ $page = new simple\MVC($app_route);
# show info about the $page object
#var_dump($page);
#if ($page->view->path === false) : header('Location: '.'/notFound'); endif;
if ($page->view->path === false) : header('Location: '.'/notFound'); endif;
// build view controller and call the page action
$controller = $page->controller->namespace . $page->controller->name;
......
......@@ -115,25 +115,24 @@ use HM;
* -
*
*/
private function view()
{
$this->path = dirname(__DIR__) . '/views/' . $this->page . '.view.php';
private function view()
{
$this->path = dirname(__DIR__) . '/views/' . $this->page . '/' . basename($this->page) . '.view.php';
if (strpos('/', $this->path) !== false) :
$dir = array_filter(explode('/', $this->page));
$dir = array_pop($dir);
$this->path = dirname(__DIR__) . '/views/' . $this->page . '/' . $dir . '.view.php';
endif;
$this->view = (object)
array(
'path' => realpath($this->path),
'file' => $this->page . '.view.php',
'name' => $this->page
);
}
$this->view = (object)
array(
'path' => realpath($this->path),
'file' => $this->page . '.view.php',
'name' => $this->page
);
}
/**
* View
*
......
{"header":[],"config":[],"pages":{"warehouses":{"controller":{"name":"warehouses","action":"warehousesAction","filename":"warehouses.controller.php","filepath":"\/kunden\/440535_21147\/webseiten\/warzz.de\/controllers\/warehouses.controller.php"},"view":{"name":"warehouses","path":"warehouses","filename":"warehouses.view.php","filepath":"\/kunden\/440535_21147\/webseiten\/warzz.de\/views\/warehouses.view.php"},"sub":{"specials":{"controller":{"name":"warehouses","action":"specialsAction","filename":"warehouses.controller.php","filepath":"\/kunden\/440535_21147\/webseiten\/warzz.de\/controllers\/warehouses.controller.php"},"view":{"name":"specials","path":"warehouses\/specials","filename":"specials.view.php","filepath":"\/kunden\/440535_21147\/webseiten\/warzz.de\/views\/warehouses\/specials.view.php"},"sub":[]}}}}}
\ No newline at end of file
{"header":[],"config":[],"pages":[]}
\ No newline at end of file
......@@ -8,6 +8,7 @@ $baseDir = dirname($vendorDir);
return array(
'HM\\Dir' => $baseDir . '/models/Dir.class.php',
'HM\\File' => $baseDir . '/models/File.class.php',
'simpleController\\blogController' => $baseDir . '/controllers/blog.controller.php',
'simpleController\\indexController' => $baseDir . '/controllers/index.controller.php',
'simpleController\\notFoundController' => $baseDir . '/controllers/notFound.controller.php',
'simple\\Controller' => $baseDir . '/simplemvc/Controller.class.php',
......
......@@ -36,6 +36,7 @@ class ComposerStaticInitc9276e89b85b1a7c62ea9fd02827598c
public static $classMap = array (
'HM\\Dir' => __DIR__ . '/../..' . '/models/Dir.class.php',
'HM\\File' => __DIR__ . '/../..' . '/models/File.class.php',
'simpleController\\blogController' => __DIR__ . '/../..' . '/controllers/blog.controller.php',
'simpleController\\indexController' => __DIR__ . '/../..' . '/controllers/index.controller.php',
'simpleController\\notFoundController' => __DIR__ . '/../..' . '/controllers/notFound.controller.php',
'simple\\Controller' => __DIR__ . '/../..' . '/simplemvc/Controller.class.php',
......
......@@ -5,10 +5,8 @@
Getting started, open <strong><i>/controller/<?= $page->controller->file; ?></i></strong>
and modifiy function <strong><i><?= $page->controller->action; ?></i></strong>!
</p>
<p>Catch easy data from controller with <i>$this</i></p>
<p>Catch easy data from controller with <i>$view</i></p>
<P><pre><? var_dump($view) ?></pre></P>
<P><pre><? #echo $view->out; ?></pre></P>
<p>powered by <a href="https://gitlab.com/mascoda/simple-mvc">simple-mvc</a></p>
</div>
</main>
\ No newline at end of file
</main>
\ No newline at end of file
<main role="main" class="flex-shrink-0">
<div class="container">
<h1 class="mt-5">404</h1>
<p class="lead">not found</p>
<p><a href="/index">Go to index</a></p>
</div>
</main>
<main role="main" class="flex-shrink-0">
<div class="container">
<h1 class="mt-5"><?= $page->view->file; ?></h1>
<p class="lead">
Getting started, open <strong><i>/controller/<?= $page->controller->file; ?></i></strong>
and modifiy function <strong><i><?= $page->controller->action; ?></i></strong>!
</p>
<p>Catch easy data from controller with <i>$view</i></p>
<P><pre><? var_dump($view) ?></pre></P>
<p>powered by <a href="https://gitlab.com/mascoda/simple-mvc">simple-mvc</a></p>
</div>
</main>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment