Version 0.9.6 beta - added new form elements, also added a nibiru binary in order to create modules and plugins.

This commit is contained in:
Stephan Kasdorf
2023-04-03 21:13:03 +02:00
parent fbe7f59697
commit b1bded6101
60 changed files with 204 additions and 66 deletions

19
core/c/controller.php Normal file → Executable file
View File

@@ -25,9 +25,10 @@ class Controller extends View
protected function __construct()
{
$this->_setConfig(Config::getInstance()->getConfig());
$this->_setController();
}
public static function getInstance(): View
public static function getInstance(): View|Controller
{
$className = get_called_class();
if( self::$_instance == null )
@@ -54,19 +55,29 @@ class Controller extends View
}
/**
* @desc will return the current controller name
* @return string
*/
public function getController()
public function getController(): string
{
return $this->_controller;
}
/**
* @desc will set the current controller name
* @param string $controller
*/
protected function setController( $controller )
protected function _setController( string $controller = "" )
{
$this->_controller = $controller;
if($controller!="")
{
$this->_controller = $controller;
}
else
{
$url = explode("/", $_SERVER['REQUEST_URI']);
$this->_controller = $url[1];
}
}
/**