本文整理匯總了PHP中HomeController::display方法的典型用法代碼示例。如果您正苦於以下問題:PHP HomeController::display方法的具體用法?PHP HomeController::display怎麽用?PHP HomeController::display使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HomeController
的用法示例。
在下文中一共展示了HomeController::display方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: display
/**
* 模板顯示 調用內置的模板引擎顯示方法,
* @access protected
* @param string $templateFile 指定要調用的模板文件
* @return void
*/
protected function display($template)
{
$file = T('Addons://' . parse_name($_GET['_addons'], 1) . '@./' . ucfirst($_GET['_controller']) . '/' . $_GET['_action']);
define('IS_ADDON', true);
parent::display($file);
// 重要:要避免陷入$this->display()循環
}
示例2: getRoute
public function getRoute()
{
// Retrieve the URI
if (strlen($this->_basepath) > 1) {
// Local Server
$uri = str_replace($this->_basepath, "", $_SERVER['REQUEST_URI']);
} else {
// AWS Server
$uri = substr($_SERVER['REQUEST_URI'], 1);
}
// If the user is not logged in, go back to Home.
if ($uri != 'Login') {
if (!isset($_SESSION['loggedin'])) {
$uri = 'Home';
}
}
if (strrpos($uri, '/') !== false) {
$uri = explode('/', $uri);
$id = $uri[1];
$uri = $uri[0] . '-';
}
// Calls the appropriate controller based on the URI.
switch ($uri) {
case 'Home':
$home = new HomeController();
$home->display();
break;
case 'Account-Summary':
$summary = new SummaryController();
$summary->display();
break;
case 'Transaction-History-':
$_SESSION['accountID'] = $id;
$pos = strrpos($_SERVER['HTTP_REFERER'], '/');
$pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Transaction-History");
break;
case 'Transaction-History':
$history = new HistoryController();
$history->display();
break;
case 'Account-Details-':
$_SESSION['detAccountID'] = $id;
$pos = strrpos($_SERVER['HTTP_REFERER'], '/');
$pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Account-Details");
break;
case 'Account-Details':
$details = new DetailsController();
$details->display();
break;
case 'New-Bill-Payment-':
$payment = new Paymentamt();
$payment->setAccountSelected($id);
$pos = strrpos($_SERVER['HTTP_REFERER'], '/');
$pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "New-Bill-Payment");
break;
case 'New-Bill-Payment':
$payment = new PaymentController();
$payment->display();
break;
case 'Bill-Payment-Amount':
$paymentamt = new PaymentamtController();
$paymentamt->display();
break;
case 'Bill-Payment-Confirmation':
$paymentconf = new PaymentconfController();
$paymentconf->display();
break;
case 'Bill-Payment-Acknowledgement':
$paymentack = new PaymentackController();
$paymentack->display();
break;
case 'Payment-List':
$paymentlist = new PaymentlistController();
$paymentlist->display();
break;
case 'Bill-Payment-List':
$_SESSION['billPayment'] = true;
unset($_SESSION['fundsTransferPayment']);
$pos = strrpos($_SERVER['HTTP_REFERER'], '/');
$pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payment-List");
break;
case 'Funds-Transfer-Payment-List':
$_SESSION['fundsTransferPayment'] = true;
unset($_SESSION['billPayment']);
$pos = strrpos($_SERVER['HTTP_REFERER'], '/');
$pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payment-List");
break;
case 'Payee-List':
$payeelist = new PayeelistController();
$payeelist->display();
break;
case 'Bill-Payee-List':
$_SESSION['billPayee'] = true;
unset($_SESSION['fundsTransferPayee']);
$pos = strrpos($_SERVER['HTTP_REFERER'], '/');
//.........這裏部分代碼省略.........
示例3: HomeController
<?php
//-+---------------------------------------------------------------------------------------------+
// A Simple and Innovative PHP Framework about Foreign Trade E-commerce @2015-07-01 Version 1.0
// 一個簡單和創新的PHP框架,為外貿電子商務開發, 始於中國共產黨建黨日,7月1日,版本1.0
//-+---------------------------------------------------------------------------------------------+
// Update from/更新地址@https://github.com/HollenMok/pandoraf_v1.0
//-+---------------------------------------------------------------------------------------------+
// Display on/項目效果展示地址 @http://www.pandoraf.com
//-+---------------------------------------------------------------------------------------------+
// Apache License/開源許可協議 @http://www.apache.org/licenses/LICENSE-2.0
//-+---------------------------------------------------------------------------------------------+
// Document support multi-language, aim to invite people worldwide join this project
// 文檔目標是支持多語言,讓全世界的人有機會了解並參加設計這個項目,目前隻支持中文與英語。
//-+---------------------------------------------------------------------------------------------+
require 'controller.php';
$controller = new HomeController();
if ($task) {
$controller->{$task}();
} else {
$controller->display();
}