diff --git a/core/c/controller.php b/core/c/controller.php index 150f9e5..bdb6700 100644 --- a/core/c/controller.php +++ b/core/c/controller.php @@ -22,6 +22,7 @@ class Controller protected function __construct() { + $this->_setController(); $this->_setConfig(Config::getInstance()->getConfig()); } @@ -62,9 +63,13 @@ class 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(); + } } /** diff --git a/core/i/controller.php b/core/i/controller.php index 5b5ef8f..0db3b1a 100644 --- a/core/i/controller.php +++ b/core/i/controller.php @@ -10,7 +10,12 @@ namespace Nibiru; */ interface IController { + /** + * @desc start name for the current Controller + * request search value for the Controller + */ const START_CONTROLLER_NAME = "index"; + const CONTROLLER_REQUEST_NAME = "controller"; /** * This should be part of any extended controller