/** * Generate the view linked to the current controller */ protected function ctrlGenerateView($dataView = array(), $action = null) { $viewAction = $this->ctrlAction; if ($action != null) { $viewAction = $action; } // Determination of the filename of the view from current controller name $ctrlClassName = get_class($this); $viewName = str_replace("Controller", "", $ctrlClassName); // Instanciation and creation of the view $view = new view($viewAction, $viewName); $view->generate($dataView); }
if (file_exists(BASEDIR . $uri) and strpos(array_pop($uri_array), ".") !== FALSE) { include BASEDIR . $uri; exit; } //open link to database server and select right database $link_identifier = mysql_connect(SERVER, USER, PASS) or die("Keine Verbindung zur Datenbank!!!!"); mysql_select_db(DATABASE, $link_identifier); //check, what's the request for... switch ($uri_array[0]) { case "suche": require_once "search/search.php"; if (isset($_GET)) { $module = new search($link_identifier); $module->perform_search(); } break; default: require_once "articles/view.php"; $module = new view($uri_array, $link_identifier); $module->generate(); break; } //parse the navigational contents include_once "parser/templ_parser.php"; $parser = new templ_parser("nav.html"); $nav = $parser->parse(); //main parse, include of content $parser = new templ_parser("main.html"); $output = $parser->parse(array("navigation" => $nav, "content" => $module->output())); //print to page print $output;
public static function error404() { $model = new model('info_error'); $view = new view('layout', 'error404', $model->getData()); return $view->generate(); }