本文整理汇总了PHP中CView::getOutput方法的典型用法代码示例。如果您正苦于以下问题:PHP CView::getOutput方法的具体用法?PHP CView::getOutput怎么用?PHP CView::getOutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CView
的用法示例。
在下文中一共展示了CView::getOutput方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: local_generateFooter
function local_generateFooter($fullscreen)
{
$pageFooter = new CView('layout.htmlpage.footer', ['fullscreen' => $fullscreen, 'user' => ['alias' => CWebUser::$data['alias'], 'debug_mode' => CWebUser::$data['debug_mode']]]);
echo $pageFooter->getOutput();
}
示例2: CView
if (CSession::keyExists('messages')) {
$messages = CSession::getValue('messages');
CSession::unsetValue(['messages']);
}
if (CSession::keyExists('messageOk')) {
$message_good = true;
$message_ok = CSession::getValue('messageOk');
} else {
$message_good = false;
$message_error = CSession::getValue('messageError');
}
CSession::unsetValue(['messageOk', 'messageError']);
}
if (!defined('ZBX_PAGE_NO_MENU')) {
$pageMenu = new CView('layout.htmlpage.menu', ['server_name' => isset($ZBX_SERVER_NAME) ? $ZBX_SERVER_NAME : '', 'menu' => ['main_menu' => $main_menu, 'sub_menus' => $sub_menus, 'selected' => $page['menu']], 'user' => ['is_guest' => CWebUser::isGuest(), 'alias' => CWebUser::$data['alias'], 'name' => CWebUser::$data['name'], 'surname' => CWebUser::$data['surname']]]);
echo $pageMenu->getOutput();
}
if ($page['type'] == PAGE_TYPE_HTML) {
echo '<div class="' . ZBX_STYLE_ARTICLE . '">';
}
// unset multiple variables
unset($table, $top_page_row, $menu_table, $main_menu_row, $sub_menu_table, $sub_menu_rows);
if ($page['type'] == PAGE_TYPE_HTML && $showGuiMessaging) {
zbx_add_post_js('initMessages({});');
}
// if a user logs in after several unsuccessful attempts, display a warning
if ($failedAttempts = CProfile::get('web.login.attempt.failed', 0)) {
$attempip = CProfile::get('web.login.attempt.ip', '');
$attempdate = CProfile::get('web.login.attempt.clock', 0);
$error_msg = _n('%4$s failed login attempt logged. Last failed attempt was from %1$s on %2$s at %3$s.', '%4$s failed login attempts logged. Last failed attempt was from %1$s on %2$s at %3$s.', $attempip, zbx_date2str(DATE_FORMAT, $attempdate), zbx_date2str(TIME_FORMAT, $attempdate), $failedAttempts);
error($error_msg);
示例3: processRequest
/**
* Process request and generate response. Main entry for all processing.
*/
private function processRequest()
{
$router = new CRouter(getRequest('action'));
$controller = $router->getController();
$controller = new $controller();
$controller->setAction($router->getAction());
$response = $controller->run();
// Controller returned data
if ($response instanceof CControllerResponseData) {
// if no view defined we pass data directly to layout
if ($router->getView() === null) {
$layout = new CView($router->getLayout(), $response->getData());
echo $layout->getOutput();
} else {
$view = new CView($router->getView(), $response->getData());
$data['page']['title'] = $response->getTitle();
$data['controller']['action'] = $router->getAction();
$data['main_block'] = $view->getOutput();
$data['fullscreen'] = isset($_REQUEST['fullscreen']) && $_REQUEST['fullscreen'] == 1 ? 1 : 0;
$data['javascript']['files'] = $view->getAddedJS();
$data['javascript']['pre'] = $view->getIncludedJS();
$data['javascript']['post'] = $view->getPostJS();
$layout = new CView($router->getLayout(), $data);
echo $layout->getOutput();
}
} else {
if ($response instanceof CControllerResponseRedirect) {
header('Content-Type: text/html; charset=UTF-8');
if ($response->getMessageOk() !== null) {
CSession::setValue('messageOk', $response->getMessageOk());
}
if ($response->getMessageError() !== null) {
CSession::setValue('messageError', $response->getMessageError());
}
global $ZBX_MESSAGES;
if (isset($ZBX_MESSAGES)) {
CSession::setValue('messages', $ZBX_MESSAGES);
}
if ($response->getFormData() !== null) {
CSession::setValue('formData', $response->getFormData());
}
redirect($response->getLocation());
} else {
if ($response instanceof CControllerResponseFatal) {
header('Content-Type: text/html; charset=UTF-8');
$response->addMessage('Controller: ' . $router->getAction());
ksort($_REQUEST);
foreach ($_REQUEST as $key => $value) {
// do not output SID
if ($key != 'sid') {
$response->addMessage($key . ': ' . $value);
}
}
CSession::setValue('messages', $response->getMessages());
redirect('zabbix.php?action=system.warning');
}
}
}
}