diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Controller/Base.php | 31 | ||||
-rw-r--r-- | app/Core/Router.php | 4 | ||||
-rw-r--r-- | app/Event/Base.php | 2 |
3 files changed, 20 insertions, 17 deletions
diff --git a/app/Controller/Base.php b/app/Controller/Base.php index da08a130..06e35e03 100644 --- a/app/Controller/Base.php +++ b/app/Controller/Base.php @@ -4,8 +4,11 @@ namespace Controller; use Pimple\Container; use Core\Tool; -use Core\Registry; use Core\Security; +use Core\Request; +use Core\Response; +use Core\Template; +use Core\Session; use Model\LastLogin; /** @@ -46,34 +49,34 @@ abstract class Base /** * Request instance * - * @accesss public - * @var \Core\Request + * @accesss protected + * @var Core\Request */ - public $request; + protected $request; /** * Response instance * - * @accesss public - * @var \Core\Response + * @accesss protected + * @var Core\Response */ - public $response; + protected $response; /** * Template instance * - * @accesss public - * @var \Core\Template + * @accesss protected + * @var Core\Template */ - public $template; + protected $template; /** * Session instance * * @accesss public - * @var \Core\Session + * @var Core\Session */ - public $session; + protected $session; /** * Container instance @@ -92,6 +95,10 @@ abstract class Base public function __construct(Container $container) { $this->container = $container; + $this->request = new Request; + $this->response = new Response; + $this->session = new Session; + $this->template = new Template; } /** diff --git a/app/Core/Router.php b/app/Core/Router.php index 1750753c..e01c16f6 100644 --- a/app/Core/Router.php +++ b/app/Core/Router.php @@ -84,10 +84,6 @@ class Router } $instance = new $class($this->container); - $instance->request = new Request; - $instance->response = new Response; - $instance->session = new Session; - $instance->template = new Template; $instance->beforeAction($this->controller, $this->action); $instance->$method(); diff --git a/app/Event/Base.php b/app/Event/Base.php index 5381471a..dfeeab55 100644 --- a/app/Event/Base.php +++ b/app/Event/Base.php @@ -22,7 +22,7 @@ use Core\Tool; abstract class Base implements Listener { /** - * Registry instance + * Container instance * * @access protected * @var Pimple\Container |