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


PHP XTemplate::getInstance方法代碼示例

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


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

示例1: init

 public static function init()
 {
     self::$xtpl = XTemplate::getInstance();
     self::$xtpl->restart('template/install.tpl');
     self::$xtpl->assign('VERSION', iVersion);
 }
開發者ID:carriercomm,項目名稱:Multicabinet,代碼行數:6,代碼來源:class.Page.php

示例2: Invoice

 public static function Invoice($invdata, $defgw = NULL)
 {
     $currency = NULL;
     $oparray = array();
     $xtpl = XTemplate::getInstance();
     $gm = GatewayModule::getInstance();
     $setting = Settings::getInstance();
     $curr = Currency::getInstance();
     $user = User::getInstance();
     $xtpl->restart("themes/simpla/invoice.tpl");
     if (count($invdata) < 2) {
         $xtpl->parse('inverror');
     } else {
         $gmodules = $gm->GetButch();
         if ($defgw == NULL) {
             $defgw = $setting->Get('system.paygateway.default');
         }
         $prov = call_user_func(array($gm->GetName($defgw) . "PaymentGateway", 'getInstance'));
         $gwdata = $gm->FetchData($defgw);
         if (strlen($gwdata['currency']) != 3) {
             $currs = $curr->GetButch();
             for ($i = 0; $i < count($currs); $i++) {
                 if (in_array($currs[$i]['name'], $prov->Currency())) {
                     if ($setting->Get('system.currency') == $currs[$i]['name'] || $currency == NULL) {
                         $currency = $currs[$i];
                     }
                 }
             }
         } else {
             $currency = $curr->FetchData($curr->GetID($gwdata['currency'], 'name'));
             //$currency = $curr->GetCurrency('', $gwdata['currency']);
         }
         $xtpl->assign('CURR', $currency);
         $xtpl->assign('AMOUNT', $curr->FormatCurrency($invdata['amount'], $currency['id']));
         $data_array['userdata'] = $user->FetchData($invdata['accountid']);
         $data_array['invoice'] = $invdata;
         $data_array['currency'] = $currency['name'];
         $data_array['invoice']['amount'] = $curr->FormatCurrency($invdata['amount'], $currency['id'], -1, true);
         $oparray = unserialize($gwdata['data']);
         $xtpl->assign('FORM', $prov->Form($oparray, $data_array));
         for ($i = 0; $i < count($gmodules); $i++) {
             $prov = call_user_func(array($gmodules[$i]['modulename'] . "PaymentGateway", 'getInstance'));
             if ($defgw == $gmodules[$i]['id']) {
                 $xtpl->assign('DEFAULT', 'selected="selected"');
             } else {
                 $xtpl->assign('DEFAULT', '');
             }
             $xtpl->assign('GM', $gmodules[$i]);
             $ginfo = $prov->Info();
             $xtpl->assign('GNAME', $ginfo['name']);
             $xtpl->parse('main.gwlist');
         }
     }
     $xtpl->assign('INV', $invdata);
     $xtpl->parse('main');
     $xtpl->out('main');
 }
開發者ID:carriercomm,項目名稱:Multicabinet,代碼行數:57,代碼來源:class.Page.php


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