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


PHP View::output方法代碼示例

本文整理匯總了PHP中View::output方法的典型用法代碼示例。如果您正苦於以下問題:PHP View::output方法的具體用法?PHP View::output怎麽用?PHP View::output使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在View的用法示例。


在下文中一共展示了View::output方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 /**
  * Starting point for every page request. Loads required core modules, gets data from url and calls
  * necessary modules to make things happen.
  */
 public static function init()
 {
     if (!self::$_inited) {
         self::$_inited = true;
         foreach (self::$_requiredCore as $module) {
             require_once ROOT . 'core/' . $module . '/' . $module . EXT;
         }
         // Set the Load::auto method to handle all class loading from now on
         spl_autoload_register('Load::auto');
         Load::loadSetupFiles();
         // If CLI mode, everything thats needed has been loaded
         if (IS_CLI) {
             return;
         }
         date_default_timezone_set(Config::get('system.timezone'));
         Event::trigger('caffeine.started');
         // If maintenance mode has been set in the config, stop everything and load mainteance view
         if (Config::get('system.maintenance_mode')) {
             View::error(ERROR_MAINTENANCE);
         } else {
             list($route, $data) = Router::getRouteData();
             if ($data) {
                 if (self::_hasPermission($route, $data)) {
                     list($module, $controller, $method) = $data['callback'];
                     $params = Router::getParams();
                     // Make sure controller words are upper-case
                     $conBits = explode('_', $controller);
                     foreach ($conBits as &$bit) {
                         $bit = ucfirst($bit);
                     }
                     $controller = implode('_', $conBits);
                     $controller = sprintf('%s_%sController', ucfirst($module), ucwords($controller));
                     // Call the routes controller and method
                     if (method_exists($controller, $method)) {
                         $response = call_user_func_array(array($controller, $method), $params);
                         if (!self::_isErrorResponse($response)) {
                             Event::trigger('module.response', array($response));
                             View::load($module, $controller, $method);
                         } else {
                             View::error($response);
                         }
                     } else {
                         Log::error($module, sprintf('The method %s::%s() called by route %s doesn\'t exist.', $controller, $method, $route));
                         View::error(ERROR_500);
                     }
                 } else {
                     View::error(ERROR_ACCESSDENIED);
                 }
             } else {
                 if ($route !== '[index]' || !View::directLoad('index')) {
                     View::error(ERROR_404);
                 }
             }
         }
         View::output();
         Event::trigger('caffeine.finished');
     } else {
         die('Why are you trying to re-initialize Caffeine?');
     }
 }
開發者ID:simudream,項目名稱:caffeine,代碼行數:64,代碼來源:index.php

示例2: output

 /**
  * buffers the top view before outputting the layout
  *
  * @return void
  */
 public function output($json = false, $id = null)
 {
     if ($this->topView() !== null) {
         $this->topView()->buffer();
     }
     parent::output();
 }
開發者ID:NePTeR,項目名稱:sonic,代碼行數:12,代碼來源:Layout.php

示例3: action

 public function action()
 {
     if ($this->check()) {
         if (!AUTHENICATED) {
             $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'index', true);
             return;
         }
         if (AUTHENICATED && !ACTIVATED) {
             $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'characters', true);
             return;
         }
         $Id = $_GET[0];
         $View = new View();
         new ControllerHelper($View, 'page-hard-article');
         $Article = $this->Manhattan->GetModel()->prepare('SELECT * FROM sulake_news WHERE id = ?')->bind(array($Id))->execute();
         if ($Article->num_rows() == 0) {
             $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'me', true);
         }
         while ($A = $Article->fetch_array()) {
             $View->set(array('article_title' => $A['title'], 'article_author' => $A['author'], 'article_date' => $A['date'], 'article_story' => nl2br($A['story']), 'article_image' => $A['image'], 'article_id' => $Id, 'page-tagline' => $A['title']));
         }
         foreach ($_SESSION['habbo'] as $Key => $Value) {
             $View->set(array('habbo_' . $Key => $Value));
         }
         $View->set(array('page-title' => $this->Manhattan->Config['Site']['Title'], 'site_title' => $this->Manhattan->Config['Site']['Title'], 'users_online' => 0, 'query_count' => $this->Manhattan->GetModel()->_count, 'exec_time' => round(microtime(true) - $this->Manhattan->Start, 3)));
         echo $View->output();
     } else {
         $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'error');
     }
 }
開發者ID:habb0,項目名稱:SulakeWeb,代碼行數:30,代碼來源:ArticlesController.php

示例4: action

 public function action()
 {
     if ($this->check()) {
         if (!AUTHENICATED) {
             $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'index', true);
             return;
         }
         if (AUTHENICATED && !ACTIVATED) {
             $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'characters', true);
             return;
         }
         $Exists = file_get_contents('Storage/Cache/Looks/' . $_SESSION['habbo']['look'] . '.png');
         $HabboLook = file_get_contents('http://www.habbo.com/habbo-imaging/avatarimage?figure=' . $_SESSION['habbo']['look'] . '.gif');
         if ($Exists && $HabboLook && $Exists != $HabboLook) {
             file_put_contents('Storage/Cache/Looks/' . $_SESSION['habbo']['look'] . '.png', file_get_contents('http://www.habbo.com/habbo-imaging/avatarimage?figure=' . $_SESSION['habbo']['look'] . '.gif'));
         }
         $View = new View();
         new ControllerHelper($View, 'page-me');
         foreach ($_SESSION['habbo'] as $Key => $Value) {
             $View->set(array('habbo_' . $Key => $Value));
         }
         $View->set(array('page-title' => $this->Manhattan->Config['Site']['Title'], 'page-tagline' => $_SESSION['habbo']['username'], 'site_title' => $this->Manhattan->Config['Site']['Title'], 'users_online' => 0, 'query_count' => $this->Manhattan->GetModel()->_count, 'exec_time' => round(microtime(true) - $this->Manhattan->Start, 3)));
         echo $View->output();
     } else {
         $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'error');
     }
 }
開發者ID:habb0,項目名稱:SulakeWeb,代碼行數:27,代碼來源:MeController.php

示例5: action

 public function action()
 {
     if ($this->check()) {
         if (!AUTHENICATED) {
             $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'index', true);
             return;
         }
         if (AUTHENICATED && !ACTIVATED) {
             $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'characters', true);
             return;
         }
         $View = new View('page-client');
         $View->javascript('swfobject');
         $this->Manhattan->GetModel()->prepare('UPDATE users SET auth_ticket = ? WHERE id = ?')->bind(array('sulake.' . $_SESSION['habbo']['username'], $_SESSION['habbo']['id']))->execute();
         $_SESSION['habbo']['auth_ticket'] = 'sulake.' . $_SESSION['habbo']['username'];
         $this->Manhattan->GetModel()->prepare('UPDATE users SET ip_last = ?, ip_reg = ? WHERE id = ?')->bind(array(IP_ADDRESS, IP_ADDRESS, $_SESSION['habbo']['id']))->execute();
         foreach ($_SESSION['habbo'] as $Key => $Value) {
             $View->set(array('habbo_' . $Key => $Value));
         }
         $View->set(array('page-title' => $this->Manhattan->Config['Site']['Title'], 'page-tagline' => 'Index'));
         echo $View->output();
     } else {
         $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'error');
     }
 }
開發者ID:habb0,項目名稱:SulakeWeb,代碼行數:25,代碼來源:ClientController.php

示例6: edit

 public function edit($id)
 {
     $view = new View("product/edit.php");
     $modelProduct = new Product();
     $product = $modelProduct->getProduct($id);
     $view->set('product', $product);
     $view->output();
 }
開發者ID:phanngoc,項目名稱:mvc_ttap_laravel,代碼行數:8,代碼來源:ProductController.php

示例7: Model

 function mvc_plugin_render()
 {
     $model = new Model($this->path);
     $controller = new Controller($model);
     $view = new View($model);
     if (isset($_REQUEST['mvc_view'])) {
         $controller->render($_REQUEST['mvc_view']);
     }
     $view->output();
 }
開發者ID:rudythesnowman,項目名稱:mvc-wordpress-plugin,代碼行數:10,代碼來源:bootstrap.php

示例8: raise_error

function raise_error($error)
{
    // init the view library
    $view = new View();
    // assign the error message
    $view->assign('error_msg', $error);
    // add the 'error' view
    $view->add('error');
    // output view
    $view->output();
    // end script execution
    exit;
}
開發者ID:aboxall,項目名稱:Framework,代碼行數:13,代碼來源:common.php

示例9: action

 public function action()
 {
     $_view = new View('404');
     $Array = explode('/', CURRENT);
     $Current = null;
     if ($Array) {
         $Request = end($Array);
         $Current = $Request . '.php';
     } else {
         $Current = CURRENT . '.php';
     }
     $_view->set(array('page-title' => '404', 'page-tagline' => 'File Not Found!', 'current_date' => date('h:m'), 'website_name' => URL, 'webmaster' => WEBMASTER, 'url' => $Current));
     echo $_view->output();
 }
開發者ID:habb0,項目名稱:SulakeWeb,代碼行數:14,代碼來源:ErrorController.php

示例10: action

 public function action()
 {
     if ($this->check()) {
         if (!AUTHENICATED) {
             $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'index', true);
             return;
         }
         $View = new View();
         new ControllerHelper($View, 'page-characters');
         $View->set(array('page-title' => $this->Manhattan->Config['Site']['Title'], 'page-tagline' => 'Characters', 'site_title' => $this->Manhattan->Config['Site']['Title'], 'users_online' => 0));
         echo $View->output();
     } else {
         $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'error');
     }
 }
開發者ID:habb0,項目名稱:SulakeWeb,代碼行數:15,代碼來源:CharactersController.php

示例11: 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

示例12: action

 public function action()
 {
     if ($this->check()) {
         if (!AUTHENICATED) {
             $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'index', true);
             return;
         }
         if (AUTHENICATED && !ACTIVATED) {
             $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'characters', true);
             return;
         }
         $View = new View();
         new ControllerHelper($View, 'page-staff');
         foreach ($_SESSION['habbo'] as $Key => $Value) {
             $View->set(array('habbo_' . $Key => $Value));
         }
         $View->set(array('page-title' => $this->Manhattan->Config['Site']['Title'], 'page-tagline' => 'Staff', 'site_title' => $this->Manhattan->Config['Site']['Title'], 'users_online' => 0, 'query_count' => $this->Manhattan->GetModel()->_count, 'exec_time' => round(microtime(true) - $this->Manhattan->Start, 3)));
         echo $View->output();
     } else {
         $this->Manhattan->GetRouter()->Direct($this->Manhattan, 'error');
     }
 }
開發者ID:habb0,項目名稱:SulakeWeb,代碼行數:22,代碼來源:StaffController.php

示例13: __construct

    private $controller;
    public function __construct($controller, $model)
    {
        $this->controller = $controller;
        $this->model = $model;
    }
    public function output()
    {
        return '<p><a href="main.php?action=clicked">' . $this->model->string . "</a></p>";
    }
}
class Controller
{
    private $model;
    public function __construct($model)
    {
        $this->model = $model;
    }
    public function clicked()
    {
        $this->model->string = "Updated Data, thanks to MVC and PHP!";
    }
}
$model = new Model();
$controller = new Controller($model);
$view = new View($controller, $model);
if (isset($_GET['action']) && !empty($_GET['action'])) {
    $controller->{$_GET['action']}();
}
echo $view->output();
開發者ID:rogermelich,項目名稱:MVC,代碼行數:30,代碼來源:main.php

示例14: foreach

    $tpl_sidenum = Option::get('tpl_sidenum');
    foreach ($custom_widget as $key => $val) {
        $custom_widget[$key] = array_map('htmlspecialchars', $val);
    }
    $customWgTitle = array();
    foreach ($widgetTitle as $key => $val) {
        if (preg_match("/^.*\\s\\((.*)\\)/", $val, $matchs)) {
            $customWgTitle[$key] = $matchs[1];
        } else {
            $customWgTitle[$key] = $val;
        }
    }
    include View::getView('header');
    require_once View::getView('widgets');
    include View::getView('footer');
    View::output();
}
//修改組件設置
if ($action == 'setwg') {
    $widgetTitle = Option::get('widget_title');
    //當前所有組件標題
    $widget = isset($_GET['wg']) ? $_GET['wg'] : '';
    //要修改的組件
    $wgTitle = isset($_POST['title']) ? $_POST['title'] : '';
    //新組件名
    preg_match("/^(.*)\\s\\(.*/", $widgetTitle[$widget], $matchs);
    $realWgTitle = isset($matchs[1]) ? $matchs[1] : $widgetTitle[$widget];
    $widgetTitle[$widget] = $realWgTitle != $wgTitle ? $realWgTitle . ' (' . $wgTitle . ')' : $realWgTitle;
    $widgetTitle = addslashes(serialize($widgetTitle));
    Option::updateOption('widget_title', $widgetTitle);
    switch ($widget) {
開發者ID:szshenjian,項目名稱:JIEWU,代碼行數:31,代碼來源:widgets.php

示例15: 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


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