* @copyright Copyright (c) 2013 - 2019, TechFuze. (http://techfuze.net) */ class RouterLoadViewAndControllerEvent extends Event { /** * The name of the view * * @var string */ public $viewName; /** * The type of view to be loaded * * @var string */ public $viewType; /** * The function that will be loaded in the view * * @var string */ public $viewMethod; /** * The parameters that will be provided to the function in the view * * @var string */ public $viewParameters; /** * The route that resulted in this controller and view * * @var string */ public $route; /** * A controller to be injected. * * @var Controller|null */ public $controller; public function init(string $viewName, string $viewType, string $viewMethod, string $viewParameters, string $route) { $this->viewName = $viewName; $this->viewType = $viewType; $this->viewMethod = $viewMethod; $this->viewParameters = $viewParameters; $this->route = $route; } /** * Override the controller to be provided to the view. * * @param Controller $controller */ public function overrideController(Controller $controller) { $this->controller = $controller; } }