version 0.2 beta nibiru framework, added onclick to the navbar json configuration, added a new dispatcher class that can handle actions as well, removed the dirty method calls fro the constructor $this->pageAction() and the navbar call, added ODBC support, and a postgress class. Overall improved the core functions of the framework.

This commit is contained in:
Stephan Kasdorf
2017-07-19 08:58:06 +02:00
parent 8a2bb432f7
commit 4a8e3493ab
14 changed files with 577 additions and 40 deletions

52
core/c/dispatcher.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
/**
* Created by PhpStorm.
* User: skasdorf
* Date: 18.07.17
* Time: 16:50
*/
namespace Nibiru;
final class Dispatcher
{
private static $_instance;
protected function __construct()
{
}
public static function getInstance()
{
$className = get_called_class();
if(self::$_instance==null) self::$_instance = new $className();
return self::$_instance;
}
public function run()
{
Router::getInstance();
Router::getInstance()->route();
require_once __DIR__ . '/../../application/controller/' . Router::getInstance()->tplName() . 'Controller.php';
$class = "Sunrise\\".\Sunrise\Router::getInstance()->tplName()."Controller";
$controller = new $class();
if(array_key_exists('_action', $_REQUEST))
{
$action = $_REQUEST['_action']."Action";
$controller->navigationAction();
$controller->$action();
$controller->pageAction();
}
else
{
$controller->navigationAction();
$controller->pageAction();
}
Debug::getInstance();
Display::getInstance()->display();
}
}