_view = new View(); } // final public function getView(): View { return $this->_view; } final public function __get($name) { return $this->getView()->$name; } final public function __set($name, $value) { $this->getView()->$name = $value; } final public function setSegments(array $segments) { $this->_segments = $segments; } final public function getSegments(string $key = ""): mixed { if ($key === "") { return $this->_segments; } return array_key_exists($key, $this->_segments) ? $this->_segments[$key] : null; } final public function getRequest(mixed $key = null, string $method = "GET"): mixed { $requestDatas = $method === "POST" ? $_POST : $_GET; $result = null; if (!$key) $result = $requestDatas; else $result = array_key_exists($key, $requestDatas) ? $requestDatas[$key] : null; return $result; } public function render(string $path) { return $this->getView()->render($path); } } //Class