Improve sidebar menus
This commit is contained in:
@@ -10,6 +10,22 @@ namespace Core;
|
||||
*/
|
||||
class Router extends Base
|
||||
{
|
||||
/**
|
||||
* Controller
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $controller = '';
|
||||
|
||||
/**
|
||||
* Action
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $action = '';
|
||||
|
||||
/**
|
||||
* Store routes for path lookup
|
||||
*
|
||||
@@ -26,6 +42,28 @@ class Router extends Base
|
||||
*/
|
||||
private $urls = array();
|
||||
|
||||
/**
|
||||
* Get action
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get controller
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getController()
|
||||
{
|
||||
return $this->controller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the path to compare patterns
|
||||
*
|
||||
@@ -208,6 +246,9 @@ class Router extends Base
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->action = $method;
|
||||
$this->controller = $controller;
|
||||
|
||||
$instance = new $class($this->container);
|
||||
$instance->beforeAction($controller, $method);
|
||||
$instance->$method();
|
||||
|
||||
Reference in New Issue
Block a user