本文整理汇总了PHP中view::output方法的典型用法代码示例。如果您正苦于以下问题:PHP view::output方法的具体用法?PHP view::output怎么用?PHP view::output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view
的用法示例。
在下文中一共展示了view::output方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editComment
public function editComment()
{
$manageCommentsModel = new ManageCommentsModel();
if (!isset($_GET['id']) && !isset($_GET['meme_id'])) {
$id = intval($_POST['id']);
$meme_id = intval($_POST['meme_id']);
$model['id'] = $id;
$model['content'] = isset($_POST['content']) ? $_POST['content'] : '';
$manageCommentsModel->UpdateItem($model);
header('location: ManageComments.php?action=listComments&meme_id=' . $meme_id);
}
$id = intval($_GET['id']);
$meme_id = intval($_GET['meme_id']);
$model = $manageCommentsModel->GetItemById($id);
$view = new view('manage_comments/editComment');
$view->assign('model', $model);
$template = new View('common/administration');
$include = str_replace('<!--[[content]]-->', $view->output(), $template->output());
echo $include;
}
示例2: editUser
public function editUser()
{
$manageUsersModel = new ManageUsersModel();
$id = intval($_GET['id']);
if ($id > 0) {
$user = $manageUsersModel->GetItemById($id);
$model['id'] = $id;
$model['username'] = $user['username'];
$model['password'] = $user['password'];
$model['firstname'] = $user['firstname'];
$model['lastname'] = $user['lastname'];
$model['email'] = $user['email'];
} else {
$model = array('id' => $id, 'username' => '', 'firstname' => '', 'lastname' => '', 'email' => '');
}
$view = new view('manage_users/edit_user');
$view->assign('model', $model);
$template = new View('common/site');
$include = str_replace('<!--[[content]]-->', $view->output(), $template->output());
echo $include;
}
示例3: 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;
示例4: showMeme
public function showMeme()
{
$manageMemesModel = new ManageMemesModel();
$id = intval($_GET['id']);
$model['meme'] = $manageMemesModel->GetMeme($id);
$model['comments'] = $manageMemesModel->GetMemeComments($id);
$model['likes'] = $manageMemesModel->GetMemeLikes($id);
$view = new view('manage_memes/show_meme');
$view->assign('model', $model);
$template = new View('common/site');
$include = str_replace('<!--[[content]]-->', $view->output(), $template->output());
echo $include;
}
示例5: login
public function login()
{
$manageUsersModel = new ManageUsersModel();
$model['username'] = isset($_POST['username']) ? $_POST['username'] : '';
$model['password'] = isset($_POST['password']) ? $_POST['password'] : '';
if ($manageUsersModel->AuthenticateUser($model['username'], $model['password'])) {
$_SESSION['logged_user'] = $model['username'];
$_SESSION['author_id'] = $manageUsersModel->getUserId($model['username'], $model['password']);
if (isset($_POST['isadmin'])) {
$_SESSION['isadmin'] = true;
}
header('location: home.php?action=index');
}
if (!isset($_POST['username']) && !isset($_POST['password'])) {
$view = new view('manage_users/singin');
$template = new View('common/site');
$include = str_replace('<!--[[content]]-->', $view->output(), $template->output());
echo $include;
} else {
$model_errors['authentication_failed'] = 'Unknown username and password!';
$view = new view('manage_users/singin');
$view->assign('model_errors', $model_errors);
$template = new View('common/site');
$include = str_replace('<!--[[content]]-->', $view->output(), $template->output());
echo $include;
}
}