本文整理汇总了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();
}