Commit 38cbcd5c authored by Webserver User's avatar Webserver User

bugfix routing

parent 2e6319ab
......@@ -61,7 +61,7 @@ use HM;
# define page from the uri
$page = ltrim(rtrim($page, '/'), '/');
$this->page = ($page === '') ? 'index' : $page;
}
/**
* Controller
......@@ -118,13 +118,17 @@ use HM;
private function view()
{
$this->path = dirname(__DIR__) . '/views/' . $this->page . '.view.php';
$dir = array_filter(explode('/', $this->page));
$dir = array_pop($dir);
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(dirname(__DIR__) . '/views/' . $this->page . '/' . $dir . '.view.php'),
'path' => realpath($this->path),
'file' => $this->page . '.view.php',
'name' => $this->page
);
......
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