$additionalInstanceName = $object; } else { getInstance()->$class = $object; } return $object; } // This function will load the view file and display it public function view($viewName, $data, $displayView = false) { // Make sure our data is in an array format if(!is_array($data)) { showError('no_array', array('data', 'Loader::view'), E_WARNING); $data = array(); } // Set the filePath for the view $filePath = settings::getFilePath() . DS . settings::getApp() . DS . 'views' . DS . $viewName . DS . 'index.php'; // Set the viewPath for the view $viewPath = array('viewPath' => DS . 'views' . DS . $viewName); // Get the websiteURL for the view $websiteInformation = getUrlInformation(); $websiteInformation = array('websiteURL' => $websiteInformation['websiteURL']); // Set the websitePath $websitePath = array('websitePath' => $websiteInformation['websiteURL'] . settings::getApplicationPath() . "/" . settings::getApp()); // Get all the applications for the view $applications = settings::getApps(); $data = array_merge($data,$viewPath, $websiteInformation, $websitePath, $applications); // extract variables extract($data); // Get our page contents if(file_exists($filePath)) { ob_start(); include($filePath); $page = ob_get_contents(); $page = str_replace("
"," " ,$page); ob_end_clean(); // Replace some Global values $Benchmark = loadClass("Benchmark"); $page = str_replace("{elapsed}", $Benchmark->elapsed('system', 4), $page); $page = str_replace("{usage}", $Benchmark->usage(), $page); $page = str_replace("", "\t\n", $page); preg_match('/]*?[^>]*>/i', $page, $body); $page = str_replace("$body[0]", "$body[0]\n