Refactoring to maintain the framework standard.
This commit is contained in:
@@ -22,6 +22,7 @@ class Controller
|
|||||||
|
|
||||||
protected function __construct()
|
protected function __construct()
|
||||||
{
|
{
|
||||||
|
$this->_setController();
|
||||||
$this->_setConfig(Config::getInstance()->getConfig());
|
$this->_setConfig(Config::getInstance()->getConfig());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,9 +63,13 @@ class Controller
|
|||||||
/**
|
/**
|
||||||
* @param string $controller
|
* @param string $controller
|
||||||
*/
|
*/
|
||||||
protected function setController( $controller )
|
private function _setController( )
|
||||||
{
|
{
|
||||||
$this->_controller = $controller;
|
if(array_key_exists( IController::CONTROLLER_REQUEST_NAME, $this->getRequest()) )
|
||||||
|
{
|
||||||
|
$this->_setNext( $this->getRequest()[IController::CONTROLLER_REQUEST_NAME] );
|
||||||
|
$this->_controller = $this->getNext();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,7 +10,12 @@ namespace Nibiru;
|
|||||||
*/
|
*/
|
||||||
interface IController
|
interface IController
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @desc start name for the current Controller
|
||||||
|
* request search value for the Controller
|
||||||
|
*/
|
||||||
const START_CONTROLLER_NAME = "index";
|
const START_CONTROLLER_NAME = "index";
|
||||||
|
const CONTROLLER_REQUEST_NAME = "controller";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This should be part of any extended controller
|
* This should be part of any extended controller
|
||||||
|
|||||||
Reference in New Issue
Block a user