本文整理汇总了PHP中View::getView方法的典型用法代码示例。如果您正苦于以下问题:PHP View::getView方法的具体用法?PHP View::getView怎么用?PHP View::getView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::getView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($params)
{
$Log_Model = new Log_Model();
$CACHE = Cache::getInstance();
$options_cache = Option::getAll();
extract($options_cache);
$page = isset($params[4]) && $params[4] == 'page' ? abs(intval($params[5])) : 1;
$author = isset($params[1]) && $params[1] == 'author' ? intval($params[2]) : '';
$pageurl = '';
$user_cache = $CACHE->readCache('user');
if (!isset($user_cache[$author])) {
show_404_page();
}
$author_name = $user_cache[$author]['name'];
//page meta
$site_title = $author_name . ' - ' . $site_title;
$sqlSegment = "and author={$author} order by date desc";
$sta_cache = $CACHE->readCache('sta');
$lognum = $sta_cache[$author]['lognum'];
$total_pages = ceil($lognum / $index_lognum);
if ($page > $total_pages) {
$page = $total_pages;
}
$start_limit = ($page - 1) * $index_lognum;
$pageurl .= Url::author($author, 'page');
$Log_Model = new Log_Model();
$logs = $Log_Model->getLogsForHome($sqlSegment, $page, $index_lognum);
$page_url = pagination($lognum, $index_lognum, $page, $pageurl);
include View::getView('header');
include View::getView('log_list');
}
示例2: display
function display($params)
{
$Log_Model = new Log_Model();
$options_cache = Option::getAll();
extract($options_cache);
$page = isset($params[4]) && $params[4] == 'page' ? abs(intval($params[5])) : 1;
$record = isset($params[1]) && $params[1] == 'record' ? intval($params[2]) : '';
$GLOBALS['record'] = $record;
//for sidebar calendar
$pageurl = '';
//page meta
$site_title = $record . ' - ' . $site_title;
if (preg_match("/^([\\d]{4})([\\d]{2})\$/", $record, $match)) {
$days = getMonthDayNum($match[2], $match[1]);
$record_stime = emStrtotime($record . '01');
$record_etime = $record_stime + 3600 * 24 * $days;
} else {
$record_stime = emStrtotime($record);
$record_etime = $record_stime + 3600 * 24;
}
$sqlSegment = "and date>={$record_stime} and date<{$record_etime} order by date desc";
$lognum = $Log_Model->getLogNum('n', $sqlSegment);
$total_pages = ceil($lognum / $index_lognum);
if ($page > $total_pages) {
$page = $total_pages;
}
$start_limit = ($page - 1) * $index_lognum;
$pageurl .= Url::record($record, 'page');
$logs = $Log_Model->getLogsForHome($sqlSegment, $page, $index_lognum);
$page_url = pagination($lognum, $index_lognum, $page, $pageurl);
include View::getView('header');
include View::getView('log_list');
}
示例3: display
function display($params)
{
$Log_Model = new Log_Model();
$options_cache = Option::getAll();
extract($options_cache);
$page = isset($params[4]) && $params[4] == 'page' ? abs(intval($params[5])) : 1;
$tag = isset($params[1]) && $params[1] == 'tag' ? addslashes(urldecode(trim($params[2]))) : '';
$pageurl = '';
//page meta
$site_title = stripslashes($tag) . ' - ' . $site_title;
$Tag_Model = new Tag_Model();
$blogIdStr = $Tag_Model->getTagByName($tag);
if ($blogIdStr === false) {
show_404_page();
}
$sqlSegment = "and gid IN ({$blogIdStr}) order by date desc";
$lognum = $Log_Model->getLogNum('n', $sqlSegment);
$total_pages = ceil($lognum / $index_lognum);
if ($page > $total_pages) {
$page = $total_pages;
}
$pageurl .= Url::tag(urlencode($tag), 'page');
$logs = $Log_Model->getLogsForHome($sqlSegment, $page, $index_lognum);
$page_url = pagination($lognum, $index_lognum, $page, $pageurl);
include View::getView('header');
include View::getView('log_list');
}
示例4: display
function display($params)
{
$Log_Model = new Log_Model();
$CACHE = Cache::getInstance();
$options_cache = Option::getAll();
extract($options_cache);
$page = isset($params[4]) && $params[4] == 'page' ? abs(intval($params[5])) : 1;
$sortid = '';
if (!empty($params[2])) {
if (is_numeric($params[2])) {
$sortid = intval($params[2]);
} else {
$sort_cache = $CACHE->readCache('sort');
foreach ($sort_cache as $key => $value) {
$alias = addslashes(urldecode(trim($params[2])));
if (array_search($alias, $value, true)) {
$sortid = $key;
break;
}
}
}
}
$pageurl = '';
$sort_cache = $CACHE->readCache('sort');
if (!isset($sort_cache[$sortid])) {
show_404_page();
}
$sort = $sort_cache[$sortid];
$sortName = $sort['sortname'];
//page meta
$site_title = $sortName . ' - ' . $site_title;
if (!empty($sort_cache[$sortid]['description'])) {
$site_description = $sort_cache[$sortid]['description'];
}
if ($sort['pid'] != 0 || empty($sort['children'])) {
$sqlSegment = "and sortid={$sortid}";
} else {
$sortids = array_merge(array($sortid), $sort['children']);
$sqlSegment = "and sortid in (" . implode(',', $sortids) . ")";
}
$sqlSegment .= " order by sortop desc, date desc";
$lognum = $Log_Model->getLogNum('n', $sqlSegment);
$total_pages = ceil($lognum / $index_lognum);
if ($page > $total_pages) {
$page = $total_pages;
}
$pageurl .= Url::sort($sortid, 'page');
$logs = $Log_Model->getLogsForHome($sqlSegment, $page, $index_lognum);
$page_url = pagination($lognum, $index_lognum, $page, $pageurl);
$template = !empty($sort['template']) && file_exists(TEMPLATE_PATH . $sort['template'] . '.php') ? $sort['template'] : 'log_list';
include View::getView('header');
include View::getView($template);
}
示例5: loginPage
/**
* 登录页面
*/
public static function loginPage($errorCode = NULL)
{
Option::get('login_code') == 'y' ? $ckcode = "<span>验证码</span>\r\n <div class=\"val\"><input name=\"imgcode\" id=\"imgcode\" type=\"text\" />\r\n <img src=\"../include/lib/checkcode.php\" align=\"absmiddle\"></div>" : ($ckcode = '');
$error_msg = '';
if ($errorCode) {
switch ($errorCode) {
case self::LOGIN_ERROR_AUTHCODE:
$error_msg = '验证错误,请重新输入';
break;
case self::LOGIN_ERROR_USER:
$error_msg = '用户名错误,请重新输入';
break;
case self::LOGIN_ERROR_PASSWD:
$error_msg = '密码错误,请重新输入';
break;
}
}
require_once View::getView('login');
View::output();
}
示例6: display
function display($params)
{
$Log_Model = new Log_Model();
$options_cache = Option::getAll();
extract($options_cache);
$page = isset($params[4]) && $params[4] == 'page' ? abs(intval($params[5])) : 1;
$keyword = isset($params[1]) && $params[1] == 'keyword' ? trim($params[2]) : '';
$keyword = addslashes(htmlspecialchars(urldecode($keyword)));
$keyword = str_replace(array('%', '_'), array('\\%', '\\_'), $keyword);
$pageurl = '';
$sqlSegment = "and title like '%{$keyword}%' order by date desc";
$lognum = $Log_Model->getLogNum('n', $sqlSegment);
$total_pages = ceil($lognum / $index_lognum);
if ($page > $total_pages) {
$page = $total_pages;
}
$pageurl .= BLOG_URL . '?keyword=' . urlencode($keyword) . '&page=';
$logs = $Log_Model->getLogsForHome($sqlSegment, $page, $index_lognum);
$page_url = pagination($lognum, $index_lognum, $page, $pageurl);
include View::getView('header');
include View::getView('log_list');
}
示例7: loginPage
/**
* 登录页面
*
*/
function loginPage()
{
Option::get('login_code') == 'y' ? $ckcode = "<span>验证码</span>\n\t<div class=\"val\"><input name=\"imgcode\" id=\"imgcode\" type=\"text\" />\n\t<img src=\"../include/lib/checkcode.php\" align=\"absmiddle\"></div>" : ($ckcode = '');
require_once View::getView('login');
View::output();
}
示例8: getForecast
/**
* Метод для непосредственного вывода прогноза на экран
* @param string $url Путь до файла с прогнозом
* @return view
*/
public static function getForecast($url)
{
self::$forecast = parent::getObjectData($url);
View::getView("forecast");
}
示例9: ascMsg
function ascMsg($msg, $url = 'javascript:history.back(-1);')
{
if (isset($_GET['gid'])) {
define('TEMPLATE_PATH', EMLOG_ROOT . '/m/view/');
$url = BLOG_URL . 'm/?post=' . intval($_GET['gid']);
include View::getView('header');
include View::getView('msg');
include View::getView('footer');
View::output();
exit;
} else {
emMsg($msg, $url);
}
}
示例10: render
public function render($view, $data = array())
{
View::getView($view, $data);
}
示例11: exit
*/
if (!defined('EMLOG_ROOT')) {
exit('error!');
}
?>
<header>
<div class="container">
<a href="#" data-activates="nav-mobile" class="button-collapse top-nav waves-effect waves-light circle hide-on-large-only">
<i class="mdi-navigation-menu"></i>
</a>
</div>
<ul id="nav-mobile" class="side-nav fixed" style="left: 0px;">
<li class="logo center">
<?php
require_once View::getView('modules/blogger');
?>
</li>
<?php
if ($widgets_exist['search']['exists']) {
?>
<li class="search">
<div class="search-wrapper card">
<form name="keyform" method="get" action="<?php
echo BLOG_URL;
?>
index.php">
<input name="keyword" class="search" type="text" id="search">
<i class="material-icons">search</i>
</form>
</div>
示例12: exit
<?php
/*
Template Name:默认模板
Description:默认模板,简洁优雅
Author:emlog
Author Url:http://www.emlog.net
*/
if (!defined('EMLOG_ROOT')) {
exit('error!');
}
require_once View::getView('module');
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php
echo $site_title;
?>
</title>
<meta name="keywords" content="<?php
echo $site_key;
?>
" />
<meta name="description" content="<?php
echo $site_description;
?>
" />
<meta name="generator" content="emlog" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
示例13: show_404_page
/**
* 显示404错误页面
*
*/
function show_404_page()
{
if (is_file(TEMPLATE_PATH . '404.php')) {
header("HTTP/1.1 404 Not Found");
include View::getView('404');
exit;
} else {
emMsg('404', BLOG_URL);
}
}
示例14: authPassword
function authPassword($postPwd, $cookiePwd, $logPwd, $logid)
{
$pwd = $cookiePwd ? $cookiePwd : $postPwd;
if ($pwd !== addslashes($logPwd)) {
include View::getView('header');
include View::getView('logauth');
include View::getView('footer');
if ($cookiePwd) {
setcookie('em_logpwd_' . $logid, ' ', time() - 31536000);
}
View::output();
} else {
setcookie('em_logpwd_' . $logid, $logPwd);
}
}
示例15: twig
public function twig($view, $attr = [])
{
View::getView(isset($this->layout) ? $this->layout : null)->twig($this->getClassFromPath(), $view, $attr);
}