/** * Get requested controller details if it exists */ private function _getControllerInfo() { $file = $this->_ctrpath . "/" . $this->_controller . ".php"; $view = $this->_tplpath . "/" . $this->_controller . "/" . $this->_action . ".php"; $styles = $this->_csspath . "/" . $this->_area . "." . $this->_controller . ".css"; $scripts = $this->_jspath . "/" . $this->_area . "." . $this->_controller . ".js"; $output = []; if (is_file($file)) { $output["base"] = $this->_basepath; $output["area"] = $this->_area; $output["name"] = $this->_controller; $output["action"] = $this->_action; $output["file"] = $file; $output["view"] = $view; $output["styles"] = is_file($styles) ? Server::getFileUrl($styles) : ""; $output["scripts"] = is_file($scripts) ? Server::getFileUrl($scripts) : ""; $output["views"] = []; foreach (glob($this->_tplpath . "/" . $this->_controller . "/*.php") as $v) { $output["views"][basename($v, ".php")] = $v; } } return $output; }
/** * Helper: Get public web url for a local file if it exists */ public function fileUrl($file = "") { return Server::getFileUrl($file); }