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:
52
core/c/dispatcher.php
Normal file
52
core/c/dispatcher.php
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user