當前位置: 首頁>>代碼示例>>PHP>>正文


PHP View::getView方法代碼示例

本文整理匯總了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');
 }
開發者ID:MikeCoder,項目名稱:mblog,代碼行數:31,代碼來源:author_controller.php

示例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');
 }
開發者ID:MikeCoder,項目名稱:mblog,代碼行數:33,代碼來源:record_controller.php

示例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');
 }
開發者ID:LockGit,項目名稱:emlog,代碼行數:27,代碼來源:tag_controller.php

示例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);
 }
開發者ID:flyysr,項目名稱:emlog,代碼行數:53,代碼來源:sort_controller.php

示例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();
 }
開發者ID:MikeCoder,項目名稱:mblog,代碼行數:23,代碼來源:loginauth.php

示例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');
 }
開發者ID:MikeCoder,項目名稱:mblog,代碼行數:22,代碼來源:search_controller.php

示例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();
}
開發者ID:MikeCoder,項目名稱:mblog,代碼行數:10,代碼來源:function.login.php

示例8: getForecast

 /**
  * Метод для непосредственного вывода прогноза на экран
  * @param  string $url Путь до файла с прогнозом
  * @return view
  */
 public static function getForecast($url)
 {
     self::$forecast = parent::getObjectData($url);
     View::getView("forecast");
 }
開發者ID:rikosage,項目名稱:forecast,代碼行數:10,代碼來源:WeatherController.php

示例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);
    }
}
開發者ID:LockGit,項目名稱:emlog,代碼行數:14,代碼來源:anti_spam_comment.php

示例10: render

 public function render($view, $data = array())
 {
     View::getView($view, $data);
 }
開發者ID:alexandre-le-borgne,項目名稱:-PHP-DUT-S3-Projet,代碼行數:4,代碼來源:Controller.php

示例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>
開發者ID:ArronYR,項目名稱:emlog-material-theme,代碼行數:31,代碼來源:nav.php

示例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">
開發者ID:flyysr,項目名稱:emlog,代碼行數:31,代碼來源:header.php

示例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);
    }
}
開發者ID:flyysr,項目名稱:emlog,代碼行數:14,代碼來源:function.base.php

示例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);
    }
}
開發者ID:LockGit,項目名稱:emlog,代碼行數:15,代碼來源:index.php

示例15: twig

 public function twig($view, $attr = [])
 {
     View::getView(isset($this->layout) ? $this->layout : null)->twig($this->getClassFromPath(), $view, $attr);
 }
開發者ID:ricco381,項目名稱:liw-core,代碼行數:4,代碼來源:Controller.php


注:本文中的View::getView方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。