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:
19
core/c/controller.php
Normal file → Executable file
19
core/c/controller.php
Normal file → Executable 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];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user