本文整理汇总了PHP中view::generate方法的典型用法代码示例。如果您正苦于以下问题:PHP view::generate方法的具体用法?PHP view::generate怎么用?PHP view::generate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view
的用法示例。
在下文中一共展示了view::generate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ctrlGenerateView
/**
* 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);
}
示例2: die
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;
示例3: error404
public static function error404()
{
$model = new model('info_error');
$view = new view('layout', 'error404', $model->getData());
return $view->generate();
}